Skip to content

Commit

Permalink
fix: rocksdb closes in destruction
Browse files Browse the repository at this point in the history
  • Loading branch information
EduMenges authored and henriqueaklein committed May 10, 2024
1 parent 5acf635 commit 0c78dc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/storage/rocksdb/rocksdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ namespace sgns::storage
{
using BlockBasedTableOptions = ::ROCKSDB_NAMESPACE::BlockBasedTableOptions;

rocksdb::~rocksdb()
{
db_->Close();
}

outcome::result<std::shared_ptr<rocksdb>> rocksdb::create(
std::string_view path, Options options)
{
Expand Down
2 changes: 1 addition & 1 deletion src/storage/rocksdb/rocksdb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace sgns::storage
using Slice = ::ROCKSDB_NAMESPACE::Slice;
using QueryResult = std::map<Buffer, Buffer>;

~rocksdb() override = default;
~rocksdb() override;

/**
* @brief Factory method to create an instance of rocksdb class.
Expand Down

0 comments on commit 0c78dc7

Please sign in to comment.