Skip to content

Fix flaky sentinel failover test: align replica master host with sentinel monitor - #4730

Merged
ggivo merged 1 commit into
redis:masterfrom
atakavci:ali/fixSentinelSetup
Sep 14, 2026
Merged

ggivo merged 1 commit into
redis:masterfrom
atakavci:ali/fixSentinelSetup

Conversation

@atakavci

@atakavci atakavci commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

JedisSentinelTest.sentinelFailover has been failing in the containerized CI since Sept 4 with
FailoverAbortedException: -failover-abort-no-good-slave (e.g. nightly run
34298534564, PR run
34321235777). The replica in the
failover env is configured with slaveof localhost 6384 while the sentinel monitors
127.0.0.1 6384. With resolve-hostnames off, Sentinel treats the replica as misconfigured and,
120 s after discovering it (failover-timeout), issues +fix-slave-config, which re-points the
replica and kills its connections. When that coincides with the test's SENTINEL FAILOVER, the
replica is disqualified and the failover aborts. This PR makes the replica config use 127.0.0.1,
matching the sentinel.

Key Decisions & Assumptions

  • No code change; only the test environment config. The same mismatch in standalone2-sentinel
    (node-6382) is fixed too, to avoid the same connection kill at the 2-minute mark.
  • The failure surfaced now because CI got ~30 s faster around Sept 4, so the test started landing
    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.12 by firing the failover 120 s after replica
discovery: 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 so slaveof uses 127.0.0.1 instead of localhost, 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-config around the failover timeout, and abort forced failovers with -failover-abort-no-good-slave. Both sentinel-standalone2-failover (node-6385) and standalone2-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.

@atakavci
atakavci requested a review from ggivo September 9, 2026 09:09
@atakavci atakavci self-assigned this Sep 9, 2026

@ggivo ggivo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ggivo
ggivo merged commit 2ccf255 into redis:master Sep 14, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants