Repository navigation
MOD-19919: Retry RDB reload saves that collide with BGSAVE - #260
Merged
Merged
Conversation
AvivDavid23
approved these changes
Oct 20, 2026
This was referenced Oct 22, 2026
Closed
gabsow
added a commit
that referenced
this pull request
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dumpAndReload()fails if its synchronousSAVEoverlaps an activeBGSAVE. Retry only the exact “Background save already in progress” response, with a ten-second deadline per connection. Other errors and an exhausted retry deadline still fail the test. Both primary and replica connections retain their own successful SAVE before DEBUG RELOAD NOSAVE, so waiting for an older background snapshot cannot lose subsequent writes.Validation: reproduced the original failure against Redis with a deliberately slowed BGSAVE. With this change, save/reload completes and a key written after the background snapshot started survives reload. The StandardEnv unit suite passes (44 passed, 4 skipped), including retry ordering, replica handling, deadline failure, and immediate propagation of other errors. Existing test warnings remain. Downstream adoption and nightly verification are still required.
Note
Low Risk
Test-harness-only change to save/reload timing; no production Redis server logic, with bounded retries and unchanged failure behavior for other errors.
Overview
dumpAndReload()no longer fails when a synchronousSAVEraces an in-flightBGSAVE. For each master (and replica, if enabled) connection, it retriesSAVEonly on the exact Redis error Background save already in progress, with a 10s deadline and short sleeps between attempts; any other error or an expired deadline still aborts beforeDEBUG RELOAD NOSAVE.Unit tests mock
StandardEnvto cover successful retry on both roles, no reload after timeout, and immediate failure for unrelated save errors.Reviewed by Cursor Bugbot for commit 913fad0. Bugbot is set up for automated code reviews on this repo. Configure here.