Repository navigation
Fix flaky sentinel failover test: align replica master host with sentinel monitor - #4730
Merged
Merged
Conversation
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.
Summary
JedisSentinelTest.sentinelFailoverhas been failing in the containerized CI since Sept 4 withFailoverAbortedException: -failover-abort-no-good-slave(e.g. nightly run34298534564, PR run
34321235777). The replica in the
failover env is configured with
slaveof localhost 6384while the sentinel monitors127.0.0.1 6384. Withresolve-hostnamesoff, Sentinel treats the replica as misconfigured and,120 s after discovering it (
failover-timeout), issues+fix-slave-config, which re-points thereplica and kills its connections. When that coincides with the test's
SENTINEL FAILOVER, thereplica is disqualified and the failover aborts. This PR makes the replica config use
127.0.0.1,matching the sentinel.
Key Decisions & Assumptions
standalone2-sentinel(
node-6382) is fixed too, to avoid the same connection kill at the 2-minute mark.in the 120β140 s window after container start. Which matrix version fails varies by run.
Testing
Reproduced locally on
client-libs-test:7.2.12by firing the failover 120 s after replicadiscovery: the old config aborts exactly as in CI, the new config completes with
+switch-master.All test classes using the two environments were re-run against the fixed config and pass.
Note
Low Risk
Test fixture config only; no production or library runtime behavior changes.
Overview
Fixes flaky
JedisSentinelTest.sentinelFailover(and similar runs) in containerized CI by updating test Redis replica configs soslaveofuses127.0.0.1instead oflocalhost, matching how Sentinel monitors the master in the same envs.With hostname resolution disabled, that mismatch led Sentinel to treat replicas as misconfigured, trigger
+fix-slave-configaround the failover timeout, and abort forced failovers with-failover-abort-no-good-slave. Bothsentinel-standalone2-failover(node-6385) andstandalone2-sentinel(node-6382) are updated; no application code changes.Reviewed by Cursor Bugbot for commit 15ed9ac. Bugbot is set up for automated code reviews on this repo. Configure here.