From cf6ed3feeb95059817d7fa8685aa04a8a33a1f92 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Thu, 9 Nov 2023 17:30:50 +0800 Subject: [PATCH] fix the wrong judgement for activerehashing in standalone mode (#12741) Introduced by #11695, the judgement should be dictIsRehashing. --- src/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.c b/src/server.c index 83c2edc77..e8553984c 100644 --- a/src/server.c +++ b/src/server.c @@ -692,13 +692,13 @@ int incrementallyRehash(int dbid) { } else { /* Rehash main dict. */ dict *main_dict = server.db[dbid].dict[0]; - if (main_dict) { + if (dictIsRehashing(main_dict)) { dictRehashMilliseconds(main_dict, INCREMENTAL_REHASHING_THRESHOLD_MS); return 1; /* already used our millisecond for this loop... */ } /* Rehash expires. */ dict *expires_dict = server.db[dbid].expires[0]; - if (expires_dict) { + if (dictIsRehashing(expires_dict)) { dictRehashMilliseconds(expires_dict, INCREMENTAL_REHASHING_THRESHOLD_MS); return 1; /* already used our millisecond for this loop... */ }