mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Empty rehashing list in emptyDbStructure (#12764)
This is currently harmless, since we have already cleared the dict before, it will reset the rehashidx to -1, and in incrementallyRehash we will call dictIsRehashing to check. It would be nice to empty the list to avoid meaningless attempts, and the code is also unified to reduce misunderstandings.
This commit is contained in:
1
src/db.c
1
src/db.c
@@ -684,6 +684,7 @@ 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);
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user