Skip to content

Commit

Permalink
review rework, added serverassert default switch case,removed debug p…
Browse files Browse the repository at this point in the history
…rints, removed unwanted reset of pointers
  • Loading branch information
a00817524 authored and JohnSully committed Nov 17, 2023
1 parent b6b7b1b commit 1d59efb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
5 changes: 1 addition & 4 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3472,11 +3472,8 @@ void redisDbPersistentData::processStorageToken(StorageToken *tok) {
tok->db->m_spstorage->complete_endWriteBatch(tok);
break;
}
case StorageToken::TokenType::SingleWrite:
{
break;
}
default:
serverAssert((tok->type == StorageToken::TokenType::SingleRead) || (tok->type == StorageToken::TokenType::BatchWrite));
break;
} //switch end

Expand Down
7 changes: 0 additions & 7 deletions src/storage/rocksdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,9 @@ void RocksDBStorageProvider::endWriteBatch()
struct BatchStorageToken : public StorageToken {
std::shared_ptr<rocksdb::DB> tspdb; // Note: This must be first so it is deleted last
std::unique_ptr<rocksdb::WriteBatchWithIndex> tspbatch;
~BatchStorageToken(){
tspdb.reset();
tspdb = nullptr;
tspbatch = nullptr;
}
};

StorageToken* RocksDBStorageProvider::begin_endWriteBatch(struct aeEventLoop *el, aePostFunctionTokenProc* callback){
serverLog(LL_WARNING, "RocksDBStorageProvider::begin_endWriteBatch");
BatchStorageToken *tok = new BatchStorageToken();
tok->tspbatch = std::move(m_spbatch);
tok->tspdb = m_spdb;
Expand All @@ -281,7 +275,6 @@ StorageToken* RocksDBStorageProvider::begin_endWriteBatch(struct aeEventLoop *el
}

void RocksDBStorageProvider::complete_endWriteBatch(StorageToken* tok){
serverLog(LL_WARNING, "RocksDBStorageProvider::complete_endWriteBatch");
delete tok;
tok = nullptr;
}
Expand Down

0 comments on commit 1d59efb

Please sign in to comment.