diff --git a/src/debug.cpp b/src/debug.cpp index 64767e30b..71740ee27 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -265,7 +265,6 @@ void xorObjectDigest(redisDb *db, robj_roptr keyobj, unsigned char *digest, robj * as input in order to ensure that a different ordered list will result in * a different digest. */ void computeDatasetDigest(unsigned char *final) { - unsigned char digest[20]; int j; uint32_t aux; @@ -282,7 +281,8 @@ void computeDatasetDigest(unsigned char *final) { mixDigest(final,&aux,sizeof(aux)); /* Iterate this DB writing every entry */ - db->iterate([&](const char *key, robj *o)->bool { + db->iterate_threadsafe([final, db](const char *key, robj_roptr o)->bool { + unsigned char digest[20]; robj *keyobj; memset(digest,0,20); /* This key-val digest */ diff --git a/src/snapshot.cpp b/src/snapshot.cpp index ee2092db6..3e1d95887 100644 --- a/src/snapshot.cpp +++ b/src/snapshot.cpp @@ -22,7 +22,7 @@ const redisDbPersistentDataSnapshot *redisDbPersistentData::createSnapshot(uint6 // If possible reuse an existing snapshot (we want to minimize nesting) if (mvccCheckpoint <= m_spdbSnapshotHOLDER->mvccCheckpoint) { - if (((getMvccTstamp() - m_spdbSnapshotHOLDER->mvccCheckpoint) >> MVCC_MS_SHIFT) < 10*1000) + if (((getMvccTstamp() - m_spdbSnapshotHOLDER->mvccCheckpoint) >> MVCC_MS_SHIFT) < 1*1000) { m_spdbSnapshotHOLDER->m_refCount++; return m_spdbSnapshotHOLDER.get(); @@ -285,7 +285,7 @@ bool redisDbPersistentDataSnapshot::iterate_threadsafe(std::functioniterate_threadsafe([&](const char *key, robj_roptr o){ + fResult = psnapshot->iterate_threadsafe([this, &fn, &celem](const char *key, robj_roptr o){ // Before passing off to the user we need to make sure it's not already in the // the current set, and not deleted dictEntry *deCurrent = dictFind(m_pdict, key);