Skip to content

MOD-18906 - Start the failover test's replicas on a protected cluster bus - #2196

Merged
LiranAbir merged 1 commit into
MOD-18751-cluster-bus-port-protected-modefrom
MOD-18906-failover-replica-cluster-bus-protected-mode
Sep 24, 2026
Merged

LiranAbir merged 1 commit into
MOD-18751-cluster-bus-port-protected-modefrom
MOD-18906-failover-replica-cluster-bus-protected-mode

Conversation

@LiranAbir

@LiranAbir LiranAbir commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

MOD-18906

Problem

test_topology_events:test_failover times out on every oss-cluster leg, and is the only test failing there (506 run, 505 passed). The phase burns 2308s before RLTest gives up. It survives both changes made for MOD-18751 — it fails identically on the old RLTest pin and with the cluster-bus waiver in place — and it passed on the 2026-09-14 nightly, before redis/redis#15722 merged.

The reason the waiver does not help: added_slaves_to_cluster spawns its replicas itself with a hand-built subprocess.Popen arg list, because RLTest's useSlaves starts replicas with cluster-enabled no so they never join the cluster. RLTest's new clusterBusPortProtectedMode option only reaches the nodes RLTest starts, not these.

Since redis/redis#15722 a cluster node whose bus port is not authenticated by tls-cluster refuses to start unless protection is waived (config.c, default 1). Those replicas therefore die at startup. The test skips when env.useTLS, so no leg is protected by TLS instead.

The failure then reads as a bare timeout because the wait for the replica to serve was the one unbounded wait in the helper — every later wait has a timeout. And a config redis rejects is reported before the logfile is opened, so the replica's log is 0 bytes and the cause appears nowhere in the run output.

Change

  • Mirror the master's cluster-bus-port-protected-mode onto the spawned replica. On older redis the config does not exist, CONFIG GET returns an empty dict, and nothing is added — passing an unknown config there would be fatal in its own right.
  • Bound the wait: bail immediately if the process has exited, naming its exit code and log, and otherwise give up after get_timeout().

Verification

Checked locally against redis/unstable at 09577d6, using the exact arg list this helper builds:

check result
the arg list as it was, on redis with #15722 exit=1, 0-byte logfile, *** FATAL CONFIG FILE ERROR ***
same plus the mirrored option starts, PONG, cluster_enabled:1, waiver warning in the log
CONFIG GET probe on redis 7.2.6 {}, so nothing is added on older redis
the old unbounded wait, replica absent still spinning after 8s — the 2308s timeout
the new bounded wait, replica refused fails in 0.1s with the exit code and log path

The suite itself still has to run in CI: reproducing it locally needs the module built against a redis carrying #15722, which is what the oss-cluster legs here will exercise.

🤖 Generated with Claude Code


Note

Low Risk
Test-only helper changes in tests/flow/utils.py; no production or runtime module code is affected.

Overview
Fixes oss-cluster test_failover timeouts by updating added_slaves_to_cluster so hand-spawned cluster replicas start on newer Redis builds.

Spawned replica argv now copies the master’s cluster-bus-port-protected-mode when CONFIG GET returns it (empty on older Redis, so nothing is added). Without this, post–redis#15722 nodes refuse to start when the cluster bus isn’t TLS-protected, and the test hung on an unbounded PING wait.

The startup loop is bounded: it raises immediately if the replica process exits (exit code + log path) or after get_timeout() if the node never answers.

Reviewed by Cursor Bugbot for commit 5cc06b9. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.11%. Comparing base (ac3397f) to head (5cc06b9).
⚠️ Report is 3 commits behind head on MOD-18751-cluster-bus-port-protected-mode.

Additional details and impacted files
@@                            Coverage Diff                             @@
##           MOD-18751-cluster-bus-port-protected-mode    #2196   +/-   ##
==========================================================================
  Coverage                                      70.11%   70.11%           
==========================================================================
  Files                                             41       41           
  Lines                                           8622     8622           
==========================================================================
  Hits                                            6045     6045           
  Misses                                          2577     2577           
Flag Coverage Δ
flow 70.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LiranAbir
LiranAbir changed the base branch from master to MOD-18751-cluster-bus-port-protected-mode September 24, 2026 10:26
@LiranAbir
LiranAbir force-pushed the MOD-18906-failover-replica-cluster-bus-protected-mode branch from b7f49cb to f6b9e82 Compare September 24, 2026 10:31
@LiranAbir

Copy link
Copy Markdown
Contributor Author

Stacked on #2194 for CI signal: on master the oss-cluster env cannot start at all (MOD-18751), so every test fails with Error 111 connecting to localhost:6379 and test_failover never runs — the first CI run here reported Total Tests Run: 3, Total Tests Failed: 3 on all three oss_cluster legs for that reason alone.

Rebased onto MOD-18751-cluster-bus-port-protected-mode and retargeted the base to it, so the oss_cluster legs now start the cluster and actually exercise test_failover. The diff here stays this one file; GitHub will retarget the base to master automatically once #2194 merges.

For the record, the only other failure in the first run was test_asm:test_asm_with_data_and_queries_during_migrations on arm64-jammy-tls_cluster (506 run, 505 passed). It is unrelated — test_failover skips under TLS, and this change only runs in added_slaves_to_cluster. The same leg passed on x64 and under the sanitizer.

@LiranAbir LiranAbir added the docker-image-changes Force CI to build Docker images locally instead of pulling prebuilt registry images. label Sep 24, 2026
@LiranAbir
LiranAbir force-pushed the MOD-18906-failover-replica-cluster-bus-protected-mode branch from 53745bf to 075902a Compare September 24, 2026 11:13
@LiranAbir
LiranAbir changed the base branch from MOD-18751-cluster-bus-port-protected-mode to MOD-18751-rltest-pin-only September 24, 2026 11:13
@LiranAbir

Copy link
Copy Markdown
Contributor Author

Restacked onto #2195 (the already-pinned RLTest plus only the new option) instead of #2194, to judge this change on its own.

The #2194 stack already showed the fix doing its job: the three oss_cluster legs went from test_failover burning 2308s on Test timeout to 506 run, 505 passed with the test failing fast on a real exception. What is left there is not this change:

File "/workspace/tests/flow/test_topology_events.py", line 220, in validate_result
    ((filtered_by, withlabels, samples),) = result
ValueError: too many values to unpack (expected 3)

That fires on the first strict_validation, before any failover, so it cannot involve the replicas. It is RESP3: #2194 moves RLTest to a commit whose redis-py constraint is redis = ">=5.0.0", where the pin this repo was already on has redis = "^5.0.0rc2", capped below 6. CI therefore installed redis-py 8.1.0, and 8.1.0 negotiates RESP3 by default (checked locally: 8.1.0 -> resp=3, 7.1.0 -> resp=2). TS.MRANGE ... GROUPBY then replies with a map, and the outer unpack consumes the single map key. The same uncapped client explains the gen, slaves, aof, aof_slaves and x64 tls_cluster failures that appeared on that stack and are absent on the old pin.

On this base redis-py stays on 5.x, so test_failover should now be green. GitHub will retarget the base once the MOD-18751 work merges.

… bus

test_topology_events:test_failover spawns its own cluster-node replicas, rather
than relying on RLTest, so RLTest's cluster-bus-port-protected-mode waiver does
not reach them. Since redis/redis#15722 a cluster node whose bus port is not
authenticated by tls-cluster refuses to start unless protection is waived, so
those replicas died at startup and the test timed out after 2308s on every
oss-cluster leg.

Mirror the master's value of the option onto the replica we spawn. The config is
absent on older redis, which reports an empty dict and gets nothing added, since
passing an unknown config would be fatal there instead.

Also bound the wait for the replica to serve. It was the one unbounded wait in
the helper, so a replica that never started produced only a test timeout, with
the cause nowhere in the output: a config redis rejects is reported before the
logfile is opened, leaving an empty log.

Co-Authored-By: Claude Opus 5 <[email protected]>
@LiranAbir
LiranAbir force-pushed the MOD-18906-failover-replica-cluster-bus-protected-mode branch from 075902a to 5cc06b9 Compare September 24, 2026 12:28
@LiranAbir
LiranAbir changed the base branch from MOD-18751-rltest-pin-only to MOD-18751-cluster-bus-port-protected-mode September 24, 2026 12:28
@LiranAbir
LiranAbir merged commit 6dda6bf into MOD-18751-cluster-bus-port-protected-mode Sep 24, 2026
25 of 40 checks passed
@LiranAbir
LiranAbir deleted the MOD-18906-failover-replica-cluster-bus-protected-mode branch September 24, 2026 12:29
@sonarqubecloud

Copy link
Copy Markdown

LiranAbir added a commit that referenced this pull request Sep 27, 2026
…ack (#2194)

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase

redis/redis#15722 added cluster-bus-port-protected-mode, and on the 8.12 line it
defaults to enabled: a node started with cluster-enabled and without tls-cluster
then refuses to start, because its cluster bus port would be unauthenticated.
That is how the oss-cluster phase is built, so every shard dies at startup and
each test fails at connect with "Connection refused". The refusal happens while
the configuration is validated, before the server opens its logfile, so the
retained logs are empty and say nothing about the cause.

Waive it for that phase. The bus ports here are bound to localhost on an
ephemeral host, which is the condition the directive documents for waiving, and
they were equally unauthenticated before the redis change - which only made
running them an explicit choice.

The option is not passed blind, because a redis that does not have it rejects
the directive and fails to start the same way. RLTest takes it as an option
rather than guessing, since nothing it can see distinguishes a build that has
the option from one that does not: the 8.12 line reports 8.9.241 in version.h,
the same as builds from before the change. CLUSTER_BUS_PROTECTED_MODE= omits it
for anyone running the cluster phase against an older redis locally.

The tls_cluster phase is left alone, since tls-cluster authenticates the bus,
and so is the existing-env phase, where RLTest starts no servers.

Requires RLTest with the option (RedisLabsModules/RLTest#255).

* Keep the waiver inside the oss-cluster phase

Setting it on RLTEST_ARGS in the OSS_CLUSTER block leaks into the tls_cluster
block below, which is a separate if and inherits the parent shell's value - the
tls_cluster phase was getting the option too, which this change had claimed it
would not. Set it inside each oss-cluster invocation's own subshell instead, as
the other phases do.

Found by dry-running tests.sh with NOP=1 and reading the generated RLTest
configuration per phase. Verified after: one occurrence, in "tests on OSS
cluster" only; the general, slaves, AOF and tls_cluster phases carry none.

Note the pre-existing duplicate --cluster_node_timeout in the tls_cluster
configuration, which comes from the same leak and is left alone here.

* Trigger CI

* MOD-18906 - Start the failover test's replicas on a protected cluster bus (#2196)

test_topology_events:test_failover spawns its own cluster-node replicas, rather
than relying on RLTest, so RLTest's cluster-bus-port-protected-mode waiver does
not reach them. Since redis/redis#15722 a cluster node whose bus port is not
authenticated by tls-cluster refuses to start unless protection is waived, so
those replicas died at startup and the test timed out after 2308s on every
oss-cluster leg.

Mirror the master's value of the option onto the replica we spawn. The config is
absent on older redis, which reports an empty dict and gets nothing added, since
passing an unknown config would be fatal there instead.

Also bound the wait for the replica to serve. It was the one unbounded wait in
the helper, so a replica that never started produced only a test timeout, with
the cause nowhere in the output: a config redis rejects is reported before the
logfile is opened, leaving an empty log.

Co-authored-by: Claude Opus 5 <[email protected]>

* MOD-18913 - Cap redis-py below 6 so the suite stays on RESP2

RLTest's own requirement on the client is uncapped (redis = ">=5.0.0"), where the
commit this repo was pinned to until now capped it at "^5.0.0rc2". Moving the pin
therefore let pip install redis-py 8.1.0, which negotiates RESP3 by default, and
under RESP3 TS.MRANGE ... GROUPBY replies with a map rather than rows:

    ((filtered_by, withlabels, samples),) = result
    ValueError: too many values to unpack (expected 3)

Pin the client to the 5.x series, which is what the old RLTest pin was silently
giving us, so the pin bump does not carry a protocol change with it. Supporting
RESP3 in the assertions is the real fix and stays with MOD-18913.

* Restore the MOD-18906 replica fix

It was reverted by accident in the previous commit, which picked up a stale
staged copy of the file alongside the requirements change.

* MOD-18913: absorb the RLTest upgrade - unescape moduleArgs semicolons (#2197)

* MOD-18913 - Pin the RLTest fix for escaped semicolons in moduleArgs

The plain-string branch of fix_modulesArgs reuses the raw input instead of
the unescaped split, so an escaped semicolon reaches the module with its
backslash. test_globalconfigs passes COMPACTION_POLICY that way, the module
then fails to load, the server never starts, and the test reports only
Connection refused against the Env it just built - on gen, slaves, aof and
aof_slaves.

Fixed upstream in RLTest#256; pinned to that commit until it merges.

Co-Authored-By: Claude Opus 5 <[email protected]>

* Trigger CI

* Point the pin at upstream RLTest now that the fix has merged

RedisLabsModules/RLTest#256 merged as 7e9f69ac1, so the escaped-semicolon fix is
available upstream and the pin no longer has to reference a fork. Same code
either way - 8dc964e was that PR's head - so this changes nothing in CI, it just
stops the branch from merging with a personal fork as a dependency.

* Spell the RLTest pin as a full SHA

An abbreviated SHA only resolves while the commit stays reachable from the
default branch, because a git fetch of a specific object needs the full hash and
an abbreviation is resolved after the clone. It works today - CI on the previous
commit passed - but it is a needless dependency on that reachability, and the
pin this replaced was a full SHA. Same commit either way.

Raised by Cursor Bugbot on 965b2db.

---------

Co-authored-by: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker-image-changes Force CI to build Docker images locally instead of pulling prebuilt registry images.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant