Retry the final key TTL after a failover - #2691
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
corcillo
approved these changes
Aug 14, 2026
amankrx
force-pushed
the
fix/redis-ttl-expire-retry
branch
from
August 14, 2026 05:19
87c89ca to
ce9aada
Compare
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.
What and why
Follow-up to #2688. @corcillo asked for the reconnect-and-retry on both
EXPIREcalls; only the temp-key one got it and I mistakenly reported both asdone. The final-key
EXPIREstill failed outright on a transient failover,while every other step in
updatereconnects and retries once.Same change routes it through
ttl_seconds(), so the clamp to at least onesecond now covers both sites rather than just the temp key. Not reachable
today since config rejects zero, but it was meant to be defence in depth at
both.
Also corrected the comment above it, which still described the pre-review
design where only the final key carried a TTL.
How this was verified
Added
update_retries_the_ttl_after_a_failover: the mock returns a connectionreset on the first
EXPIREof the real key and succeeds on the retry. Itfails with the retry arm removed, with the error the reviewer predicted:
Full store suite (30 binaries) and clippy are clean.
Risk
Low. One more round trip only on a failover that would previously have failed
the write.
The retry is bounded to a single attempt, matching the rename directly above
it, so a persistently unreachable master still surfaces an error rather than
looping.
This change is