diff --git a/storage/include/rocksdb/client.h b/storage/include/rocksdb/client.h index 1ee334de6b..5e921a4ee0 100644 --- a/storage/include/rocksdb/client.h +++ b/storage/include/rocksdb/client.h @@ -20,7 +20,7 @@ #ifdef USE_ROCKSDB #include "Logger.hpp" #include -#include +#include #include #include "storage/db_interface.h" #include "storage/storage_metrics.h" @@ -158,7 +158,7 @@ class Client : public concord::storage::IDBClient { // Database object (created on connection). std::unique_ptr<::rocksdb::DB> dbInstance_; - ::rocksdb::TransactionDB* txn_db_ = nullptr; + ::rocksdb::OptimisticTransactionDB* txn_db_ = nullptr; std::unique_ptr comparator_; std::map cf_handles_; diff --git a/storage/src/rocksdb_client.cpp b/storage/src/rocksdb_client.cpp index a4ae95a0c7..cc2bd5ed05 100644 --- a/storage/src/rocksdb_client.cpp +++ b/storage/src/rocksdb_client.cpp @@ -182,8 +182,9 @@ void Client::openRocksDB(bool readOnly, s.ToString()); dbInstance_.reset(db); } else { - ::rocksdb::TransactionDBOptions txn_options; - s = ::rocksdb::TransactionDB::Open(db_options, txn_options, m_dbPath, cf_descs, &raw_cf_handles, &txn_db_); + ::rocksdb::OptimisticTransactionDBOptions txn_options; + s = ::rocksdb::OptimisticTransactionDB::Open( + db_options, txn_options, m_dbPath, cf_descs, &raw_cf_handles, &txn_db_); unique_cf_handles = raw_to_unique_cf_handles(raw_cf_handles); if (!s.ok()) throw std::runtime_error("Failed to open rocksdb database at " + m_dbPath + std::string(" reason: ") +