async rehash is preventing rehashing during RDB load after a db flush. Ensure it can't interefere after a flush

This commit is contained in:
John Sully 2023-09-23 19:46:35 +00:00 committed by John Sully
parent cfe257a9c7
commit 68d751046e

View File

@ -2740,6 +2740,13 @@ void redisDbPersistentData::clear(void(callback)(void*))
if (m_spstorage != nullptr)
m_spstorage->clear(callback);
dictEmpty(m_pdictTombstone,callback);
// To avoid issues with async rehash we completly free the old dict and create a fresh one
dictRelease(m_pdict);
dictRelease(m_pdictTombstone);
m_pdict = dictCreate(&dbDictType, this);
m_pdictTombstone = dictCreate(&dbTombstoneDictType, this);
m_pdbSnapshot = nullptr;
m_numexpires = 0;
}