Skip to content

Commit

Permalink
Fix dict don't rehash when there is child test (redis#13035)
Browse files Browse the repository at this point in the history
The reason is the same as redis#13016. The reason is that in redis#12819,
in cron, in addition to trying to shrink, we will also tyring
to expand. The dict was expanded by cron before we trigger the
bgsave since we do have the enough keys (4096) to hit the radio.

Before the bgsave, we only add 4095 keys to avoid this issue.
  • Loading branch information
enjoy-binbin authored Feb 7, 2024
1 parent 1f00c95 commit 886b117
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/other.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ start_server {tags {"other external:skip"}} {
r config set save ""
r config set rdb-key-save-delay 1000000

populate 4096 "" 1
populate 4095 "" 1
r bgsave
wait_for_condition 10 100 {
[s rdb_bgsave_in_progress] eq 1
Expand All @@ -375,7 +375,7 @@ start_server {tags {"other external:skip"}} {
waitForBgsave r

# Hash table should rehash since there is no child process,
# size is power of two and over 4098, so it is 8192
# size is power of two and over 4096, so it is 8192
wait_for_condition 50 100 {
[string match "*table size: 8192*" [r debug HTSTATS 9]]
} else {
Expand Down

0 comments on commit 886b117

Please sign in to comment.