Skip to content

Conversation

@tezc
Copy link
Collaborator

@tezc tezc commented Dec 2, 2024

In #13495, we introduced a feature to reply -LOADING while flushing a large db on a replica.
While _dictClear() is in progress, it calls a callback for every 65k items and we yield back to eventloop to reply -LOADING.

This change has made some tests unstable as those tests don't expect new -LOADING reply.
One observation, inside _dictClear(), we call the callback even if db has a few keys. Most tests run with small amount of keys. So, each replication and cluster test has to handle potential -LOADING reply now.

This PR changes this behavior, skips calling callback when i=0 to stabilize replication tests.
Callback will be called after the first 65k items. Most tests use less than 65k keys and they won't get -LOADING reply.

@tezc tezc requested a review from sundb December 2, 2024 09:38
@ShooterIT
Copy link
Member

make sense, LGTM

@tezc tezc merged commit 2af69a9 into redis:unstable Dec 3, 2024
14 checks passed
@tezc tezc deleted the fix-dictclear branch December 3, 2024 06:26
funny-dog pushed a commit to funny-dog/redis that referenced this pull request Sep 17, 2025
)

In redis#13495, we introduced a feature to
reply -LOADING while flushing a large db on a replica.
While `_dictClear()` is in progress, it calls a callback for every 65k
items and we yield back to eventloop to reply -LOADING.

This change has made some tests unstable as those tests don't expect new
-LOADING reply.
One observation, inside `_dictClear()`, we call the callback even if db
has a few keys. Most tests run with small amount of keys. So, each
replication and cluster test has to handle potential -LOADING reply now.

This PR changes this behavior, skips calling callback when `i=0` to
stabilize replication tests.
Callback will be called after the first 65k items. Most tests use less
than 65k keys and they won't get -LOADING reply.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants