From c77419def94c84cfa6d12fcc52059e53aa802260 Mon Sep 17 00:00:00 2001 From: a00817524 Date: Tue, 31 Oct 2023 03:41:38 +0000 Subject: [PATCH] missed changes --- src/storage/rocksdb.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/storage/rocksdb.cpp b/src/storage/rocksdb.cpp index 3ed94be60..3b7b9ec18 100644 --- a/src/storage/rocksdb.cpp +++ b/src/storage/rocksdb.cpp @@ -265,24 +265,23 @@ struct BatchStorageToken : public StorageToken { } }; -StorageToken* RocksDBStorageProvider::begin_endWriteBatch(struct aeEventLoop *el, aePostFunctionTokenProc* callback) -{ +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; + m_spbatch = nullptr; + m_lock.unlock(); (*m_pfactory->m_wqueue)->AddWorkFunction([this, el,callback,tok]{ tok->tspdb->Write(WriteOptions(),tok->tspbatch.get()); aePostFunction(el,callback,tok); }); - m_spbatch = nullptr; - m_lock.unlock(); + return tok; } void RocksDBStorageProvider::complete_endWriteBatch(StorageToken* tok){ - // serverLog(LL_WARNING, "RocksDBStorageProvider::complete_endWriteBatch"); - m_lock.unlock(); + serverLog(LL_WARNING, "RocksDBStorageProvider::complete_endWriteBatch"); delete tok; tok = nullptr; }