Unverified Commit 29e6245a authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix unexpected resize causing test failure (#12960)

Before #12850, we will only try to shrink the dict in serverCron,
which we can control by using a child process, but now every time
we delete a key, the shrink check will be called.

In these test (added in #12802), we meant to disable the resizing,
but druing the delete, the dict will meet the force shrink, like
2 / 128 = 0.015 < 0.2, the delete will trigger a force resize and
will cause the test to fail.

In this commit, we try to keep the load factor at 3 / 128 = 0.023,
that is, do not meet the force shrink.
parent 14b1edfd
...@@ -439,8 +439,8 @@ start_cluster 1 0 {tags {"other external:skip cluster slow"}} { ...@@ -439,8 +439,8 @@ start_cluster 1 0 {tags {"other external:skip cluster slow"}} {
r config set rdb-key-save-delay 10000000 r config set rdb-key-save-delay 10000000
r bgsave r bgsave
# delete data to have lot's (99%) of empty buckets # delete data to have lot's (98%) of empty buckets
for {set j 1} {$j <= 127} {incr j} { for {set j 1} {$j <= 125} {incr j} {
r del "{foo}$j" r del "{foo}$j"
} }
assert_match "*table size: 128*" [r debug HTSTATS 0] assert_match "*table size: 128*" [r debug HTSTATS 0]
...@@ -470,7 +470,7 @@ start_cluster 1 0 {tags {"other external:skip cluster slow"}} { ...@@ -470,7 +470,7 @@ start_cluster 1 0 {tags {"other external:skip cluster slow"}} {
r config set rdb-key-save-delay 10000000 r config set rdb-key-save-delay 10000000
r bgsave r bgsave
for {set j 1} {$j <= 127} {incr j} { for {set j 1} {$j <= 125} {incr j} {
r del "{alice}$j" r del "{alice}$j"
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment