Skip to content

Commit

Permalink
reset bucket_count when empty db
Browse files Browse the repository at this point in the history
  • Loading branch information
soloestoy committed Nov 10, 2023
1 parent cf6ed3f commit afc0ffb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/db.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,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) {
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 afc0ffb

Please sign in to comment.