diff --git a/src/db.cpp b/src/db.cpp index 69d5a6405..3accdd361 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -2989,6 +2989,7 @@ void redisDbPersistentData::processChangesAsync(std::atomic &pendingJobs) dict *dictNew = dictCreate(&dbDictType, nullptr); std::swap(dictNew, m_pdict); m_cnewKeysPending = 0; + m_numexpires = 0; g_pserver->asyncworkqueue->AddWorkFunction([dictNew, this, &pendingJobs]{ dictIterator *di = dictGetIterator(dictNew); dictEntry *de; diff --git a/src/rdb.cpp b/src/rdb.cpp index 997ef67f3..15946f01c 100644 --- a/src/rdb.cpp +++ b/src/rdb.cpp @@ -2865,6 +2865,12 @@ class rdbAsyncWorkThread size_t endWork() { if (!fLaunched) { + for (int idb = 0; idb < cserver.dbnum; ++idb) { + if (g_pserver->m_pstorageFactory) { + g_pserver->db[idb]->processChangesAsync(cstorageWritesInFlight); + } + } + while (cstorageWritesInFlight > 0); return ckeysLoaded; } if (!vecbatch.empty()) {