From 5df39b56acd6f1a6b34682f9719f9c9236d7126b Mon Sep 17 00:00:00 2001 From: John Sully Date: Mon, 7 Mar 2022 16:39:01 -0500 Subject: [PATCH] Fix cluster test fail --- src/db.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/db.cpp b/src/db.cpp index e55c887a3..a115c887b 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -2488,7 +2488,10 @@ void slotToKeyUpdateKeyCore(const char *key, size_t keylen, int add) { } else { fModified = raxRemove(g_pserver->cluster->slots_to_keys,indexed,keylen+2,NULL); } - serverAssert(fModified); + // This assert is disabled when a snapshot depth is >0 because prepOverwriteForSnapshot will add in a tombstone, + // this prevents ensure from adding the key to the dictionary which means the caller isn't aware we're already tracking + // the key. + serverAssert(fModified || g_pserver->db[0]->snapshot_depth() > 0); if (indexed != buf) zfree(indexed); }