Skip to content

Commit 68d7510

Browse files
JohnSullyJohn Sully
authored andcommitted
async rehash is preventing rehashing during RDB load after a db flush. Ensure it can't interefere after a flush
1 parent cfe257a commit 68d7510

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/db.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,13 @@ void redisDbPersistentData::clear(void(callback)(void*))
27402740
if (m_spstorage != nullptr)
27412741
m_spstorage->clear(callback);
27422742
dictEmpty(m_pdictTombstone,callback);
2743+
2744+
// To avoid issues with async rehash we completly free the old dict and create a fresh one
2745+
dictRelease(m_pdict);
2746+
dictRelease(m_pdictTombstone);
2747+
m_pdict = dictCreate(&dbDictType, this);
2748+
m_pdictTombstone = dictCreate(&dbTombstoneDictType, this);
2749+
27432750
m_pdbSnapshot = nullptr;
27442751
m_numexpires = 0;
27452752
}

0 commit comments

Comments
 (0)