From 29faa06028e15f0a8e8a0967b105b48771058400 Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 9 Jun 2020 20:59:09 -0400 Subject: [PATCH] Fix assert false alarm when freeTombstoneObjects is called Former-commit-id: e21a011072505cfa0a37afefb94f7270e80625c5 --- src/snapshot.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/snapshot.cpp b/src/snapshot.cpp index f863a2b1d..0f5bb079e 100644 --- a/src/snapshot.cpp +++ b/src/snapshot.cpp @@ -502,10 +502,13 @@ void redisDbPersistentDataSnapshot::consolidate_children(redisDbPersistentData * spdb->initialize(); dictExpand(spdb->m_pdict, m_pdbSnapshot->size()); + volatile size_t skipped = 0; m_pdbSnapshot->iterate_threadsafe([&](const char *key, robj_roptr o) { if (o != nullptr) { dictAdd(spdb->m_pdict, sdsdupshared(key), o.unsafe_robjcast()); incrRefCount(o); + } else { + ++skipped; } return true; }, true /*fKeyOnly*/, true /*fCacheOnly*/); @@ -518,7 +521,11 @@ void redisDbPersistentDataSnapshot::consolidate_children(redisDbPersistentData * spdb->m_pdict->iterators++; - serverAssert(spdb->size() == m_pdbSnapshot->size()); + if (m_spstorage) { + serverAssert(spdb->size() == m_pdbSnapshot->size()); + } else { + serverAssert((spdb->size()+skipped) == m_pdbSnapshot->size()); + } // Now wire us in (Acquire the LOCK) AeLocker locker;