From 65f96b6de3fa00ce710733e93a81b1daed7c441e Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 2 Jun 2020 23:59:24 -0400 Subject: [PATCH] Fix crash when overwriting key stored in FLASH but not in ram during a BGSAVE while clustering is enabled Former-commit-id: 32967b1d671b151bed976e3d13ce26c7e1496c82 --- src/db.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db.cpp b/src/db.cpp index fdb167dec..770958381 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -2335,7 +2335,7 @@ void redisDbPersistentData::ensure(const char *sdsKey, dictEntry **pde) { auto itr = m_pdbSnapshot->find_cached_threadsafe(sdsKey); if (itr == m_pdbSnapshot->end()) - return; // not found + goto LNotFound; sds keyNew = sdsdupshared(itr.key()); // note: we use the iterator's key because the sdsKey may not be a shared string if (itr.val() != nullptr) @@ -2363,6 +2363,7 @@ void redisDbPersistentData::ensure(const char *sdsKey, dictEntry **pde) } } +LNotFound: // If we haven't found it yet check our storage engine if (*pde == nullptr && m_spstorage != nullptr) {