Fix assert false alarm when freeTombstoneObjects is called

Former-commit-id: e21a011072505cfa0a37afefb94f7270e80625c5
This commit is contained in:
John Sully 2020-06-09 20:59:09 -04:00
parent ec01cc23b1
commit 29faa06028

View File

@ -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;