From 1d59efbfbd1f0d8b3a613084139f89ce5ac5c8b2 Mon Sep 17 00:00:00 2001 From: a00817524 Date: Wed, 8 Nov 2023 20:52:23 +0000 Subject: [PATCH] review rework, added serverassert default switch case,removed debug prints, removed unwanted reset of pointers --- src/db.cpp | 5 +---- src/storage/rocksdb.cpp | 7 ------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index a04b5700e..9a0f35684 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -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 diff --git a/src/storage/rocksdb.cpp b/src/storage/rocksdb.cpp index 8c4429f3b..56f00821f 100644 --- a/src/storage/rocksdb.cpp +++ b/src/storage/rocksdb.cpp @@ -258,15 +258,9 @@ void RocksDBStorageProvider::endWriteBatch() struct BatchStorageToken : public StorageToken { std::shared_ptr tspdb; // Note: This must be first so it is deleted last std::unique_ptr 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; @@ -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; }