From a430473a39e2f5f109fee389f34aa1ae6b092004 Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 19 Mar 2024 03:28:48 +0000 Subject: [PATCH] Fix asserts after RDB load with FLASH --- src/db.cpp | 1 + src/rdb.cpp | 6 ++++++ 2 files changed, 7 insertions(+) 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()) {