Repository navigation
Fix RedisCluster topology recovery after routing changes - #3007
Closed
moosavimaleki wants to merge 2 commits into
Closed
moosavimaleki wants to merge 2 commits into
moosavimaleki wants to merge 2 commits into
Conversation
added 2 commits
November 16, 2026 16:07
Build replacement slot maps before publishing them, preserve usable sockets, and close retired connections. Refresh the full map once per command after MOVED, with known-node discovery and a per-slot fallback if discovery fails. Distinguish unsent commands from ambiguous writes and limit rejected-command retries to ordinary commands. Preserve ASK and stateful command boundaries, handle uncovered slots and empty endpoints, and invalidate stale slot caches. Add deterministic topology regressions and a disposable-cluster integration runner. Validate Redis and RedisCluster suites, repeated failovers, resharding, TLS/ACL, cache/persistent combinations, and memory safety with Valgrind.
Remove the new READONLY/CLUSTERDOWN retry policy and unsent-command recovery. Restore the existing develop transport helpers and command callers, keeping only the bounded full-map refresh and its required topology safety changes. Match the scope of the internal 6.3.0 master backport without importing its legacy APIs. Keep authentication, cache invalidation, socket ownership, and WATCH/MULTI protections. Remove tests for the excluded recovery policies. Rebuild and validate the Redis and RedisCluster suites, focused Valgrind regressions, and real TLS/ACL failovers and two-slot resharding. Do not repeat load testing for this scope reduction.
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.
RedisCluster can retain stale topology after MOVED redirects: updating one
slot does not update other moved slots or primary/replica relationships.
Recovery can also fail when the previous primary has no replicas.
This change refreshes the complete topology once per command after MOVED,
using the redirect target, known nodes, and configured seeds. If discovery
fails, the previous map remains available and the validated redirect is
followed for the affected slot.
Changes
scripts, distributed operations, and explicitly directed commands.
No public PHP API changes or background polling are introduced.
Validation
Tested with PHP 8.5.4 and Redis 8.0.5:
memory errors or definitely/indirectly/possibly lost allocations.
persistent connections, TLS, and ACL authentication.
This overlaps with #2957 and #2958, and touches remapping paths also modified
by #2798 and #2655.