From b8015a4c2f9a92bfc42296424f6c7cd267a0491a Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 16 Dec 2019 22:07:53 -0500 Subject: [PATCH] complete snapshot handling of expires, may still be perf issues Former-commit-id: 7c6cf4ba4696ba8a7b4069491e8ad0a583958bdc --- src/snapshot.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/snapshot.cpp b/src/snapshot.cpp index 7972dcf9a..0664f8f45 100644 --- a/src/snapshot.cpp +++ b/src/snapshot.cpp @@ -47,11 +47,10 @@ const redisDbPersistentDataSnapshot *redisDbPersistentData::createSnapshot(uint6 spdb->m_refCount = 1; spdb->mvccCheckpoint = getMvccTstamp(); if (m_setexpire != nullptr) - spdb->m_setexpire = m_setexpire; + spdb->m_setexpire = new (MALLOC_LOCAL) expireset(*m_setexpire); m_pdict = dictCreate(&dbDictType,this); m_pdictTombstone = dictCreate(&dbDictType, this); - m_setexpire = new (MALLOC_LOCAL) expireset(); serverAssert(spdb->m_pdict->iterators == 1); @@ -197,20 +196,11 @@ void redisDbPersistentData::endSnapshot(const redisDbPersistentDataSnapshot *psn } if (dictGetVal(de) != nullptr) incrRefCount((robj*)dictGetVal(de)); - - if (o->FExpires() || o == nullptr) - { - auto itr = m_setexpire->find((const char*)dictGetKey(de)); - serverAssert(o == nullptr || itr != m_setexpire->end()); - if (itr != m_setexpire->end()) - m_spdbSnapshotHOLDER->m_setexpire->insert(*itr); - } } dictReleaseIterator(di); // Stage 3 swap the databases with the snapshot std::swap(m_pdict, m_spdbSnapshotHOLDER->m_pdict); - std::swap(m_setexpire, m_spdbSnapshotHOLDER->m_setexpire); if (m_spdbSnapshotHOLDER->m_pdbSnapshot != nullptr) std::swap(m_pdictTombstone, m_spdbSnapshotHOLDER->m_pdictTombstone);