From 9b6dded421cbd0eed78c4da28196de7ef5adb6e8 Mon Sep 17 00:00:00 2001 From: Binbin Date: Thu, 16 Nov 2023 17:18:25 +0800 Subject: [PATCH] Fix empty rehashing list in swapdb mode (#12770) In swapdb mode, the temp db does not init the rehashing list, the change added in #12764 caused cluster ci to fail. --- src/db.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db.c b/src/db.c index 52ac7965e64..c4c22907eb7 100644 --- a/src/db.c +++ b/src/db.c @@ -684,7 +684,8 @@ long long emptyDbStructure(redisDb *dbarray, int dbnum, int async, dbarray[j].sub_dict[subdict].key_count = 0; dbarray[j].sub_dict[subdict].resize_cursor = 0; if (server.cluster_enabled) { - listEmpty(dbarray[j].sub_dict[subdict].rehashing); + if (dbarray[j].sub_dict[subdict].rehashing) + listEmpty(dbarray[j].sub_dict[subdict].rehashing); dbarray[j].sub_dict[subdict].bucket_count = 0; unsigned long long *slot_size_index = dbarray[j].sub_dict[subdict].slot_size_index; memset(slot_size_index, 0, sizeof(unsigned long long) * (CLUSTER_SLOTS + 1));