Skip to content

Commit

Permalink
Fix empty rehashing list in swapdb mode (redis#12770)
Browse files Browse the repository at this point in the history
In swapdb mode, the temp db does not init the rehashing list,
the change added in redis#12764 caused cluster ci to fail.
  • Loading branch information
enjoy-binbin authored Nov 16, 2023
1 parent 4366bba commit 9b6dded
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9b6dded

Please sign in to comment.