Skip to content

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

Merged
LiranAbir merged 3 commits into
masterfrom
MOD-18751-cluster-bus-port-protected-mode
Sep 27, 2026
Merged

LiranAbir merged 3 commits into
masterfrom
MOD-18751-cluster-bus-port-protected-mode

Conversation

@LiranAbir

@LiranAbir LiranAbir commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

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 yes and without tls-cluster then refuses to start, because its cluster bus port would be unauthenticated. That is exactly how the oss-cluster phase is built, so every shard dies at startup and each test fails at connect:

Running tests on OSS cluster:
  Unhandled exception: Error 111 connecting to localhost:6379. Connection refused.

The refusal happens while the configuration is being validated, before the server opens its logfile, so the retained logs are empty and say nothing about the cause. Tracked as MOD-18751 — every oss-cluster leg across this repo, RedisBloom and RedisJSON, public and dev forks, has been red on every run since 2026-09-15.

Change

  • Waive the protection for the oss-cluster phase.
  • Bump the RLTest pin, in both requirements_docker.txt and the tests' requirements.txt, to a version that has the option.

Waiving is the documented condition, not a shortcut: the bus ports here are bound to localhost on an ephemeral host, and they were equally unauthenticated before the redis change — which only made running them an explicit choice. redis waived it the same way in its own harness in that PR.

Why it is not passed unconditionally

A redis that does not have the option rejects the directive and fails to start the same way, whichever value is given — the name is what is unknown, not the value. So CLUSTER_BUS_PROTECTED_MODE= omits it, for anyone running the cluster phase against an older redis locally:

CLUSTER_BUS_ARGS="--cluster_bus_port_protected_mode ${CLUSTER_BUS_PROTECTED_MODE-no}"
[[ -z ${CLUSTER_BUS_PROTECTED_MODE-no} ]] && CLUSTER_BUS_ARGS=""

RLTest takes this as a caller option rather than working it out itself, because nothing it can see separates 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. Versions carrying it: 8.12 and up, plus the 8.2.10 / 8.4.7 / 8.6.7 / 8.8.3 / 8.10.2 backports, where it defaults to disabled and the flag is a harmless no-op.

Untouched

  • tls_cluster phase — tls-cluster authenticates the bus, so protection is already satisfied.
  • existing-env / RLEC phase — RLTest starts no servers.

Verification

Built redis at 7a72677e (8.9.241, the 8.12 line) and ran a 3-shard oss-cluster through RLTest for each value:

binary value result
8.9.241 (8.12 line) omitted fails — Connection refused (this bug)
8.9.241 (8.12 line) no cluster starts
8.9.241 (8.12 line) yes fails, as it should — protection enforced
7.2.6 (no option) omitted cluster starts

3/3 shards receive the option when set, 0/3 when omitted.

Note the build-linux-* legs install RLTest into the prebuilt ghcr image, whose tag is the redis ref rather than a content hash, so the new pin only takes effect once Push Docker Images rebuilds.

🤖 Generated with Claude Code


Note

Low Risk
Changes are limited to test dependency pins and the flow test harness; no module runtime or production paths are modified.

Overview
Fixes oss-cluster flow tests that fail against Redis 8.12+ when cluster-bus-port-protected-mode defaults on and blocks unauthenticated cluster bus startup.

tests/flow/tests.sh now passes --cluster_bus_port_protected_mode no into RLTest for the oss-cluster leg by default, with CLUSTER_BUS_PROTECTED_MODE= clearing the flag so older Redis builds that do not recognize the directive still start.

RLTest is pinned to 0.7.29 in requirements_docker.txt and tests/flow/requirements.txt, and redis ~= 5.0.8 is added so pip does not pull redis-py 6, which breaks tests that recreate clients from pool connection_kwargs (MOD-18341).

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

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).
@LiranAbir

Copy link
Copy Markdown
Collaborator Author

Blocked on the RLTest release. This pins RLTest 0.7.29, which is not on PyPI yet — the tag is on the way. Until it publishes, CI here will fail at dependency install, not on the change itself.

RedisTimeSeries' equivalent PR is git-pinned to the RLTest merge commit, so it can go ahead of this one.

Order that matters: the pin and the tests.sh flag must both be in before judging a nightly. RLTest defaults to omitting the option, so the pin alone changes nothing.

@LiranAbir
LiranAbir requested a review from gabsow September 23, 2026 11:48
@LiranAbir LiranAbir added the docker-image-changes Release a new image containing the latest changes. label Sep 24, 2026
@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 83.67%. Comparing base (4968e44) to head (d651c24).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1068      +/-   ##
==========================================
- Coverage   83.73%   83.67%   -0.06%     
==========================================
  Files          21       21              
  Lines        3455     3455              
==========================================
- Hits         2893     2891       -2     
- Misses        562      564       +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Nothing here pinned the client, and RLTest's own requirement is uncapped
(redis = ">=5.0.0"), so pip installs redis-py 8.1.0. From redis-py 6 on, a
connection pool carries kwargs that Redis.__init__ does not accept, so the tests
that rebuild a raw client out of an existing pool's connection_kwargs fail:

    raw = redis.Redis(**kwargs)
    TypeError: Redis.__init__() got an unexpected keyword argument 'himport_registry'

That is every build-linux leg on both architectures, on four tests in test_cms
and test_overall. Pin the client to the 5.x series, which is what the previous
RLTest pin was capping it to in effect.
@LiranAbir

LiranAbir commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Capped redis-py below 6 on this branch.

Nothing here pinned the client, and RLTest requires it as redis = ">=5.0.0", so pip installed redis-py 8.1.0. From redis-py 6 on a connection pool carries kwargs that Redis.__init__ does not accept, so the tests that rebuild a raw client out of an existing pool fail:

File "/workspace/tests/flow/test_cms.py", line 529, in test_cell_size_dump_restore
    raw = redis.Redis(**kwargs)
TypeError: Redis.__init__() got an unexpected keyword argument 'himport_registry'

That was every build-linux leg on both architectures — four tests across test_cms and test_overall, 238 run, 4 failed. It is MOD-18341, not new here, but the bump to RLTest == 0.7.29 is what let the newest client in, so it surfaces on this PR. redis ~= 5.0.8 is what RedisJSON already pins.

For the record, the RedisTimeSeries counterpart of this waiver also needed a fix for tests that spawn their own cluster-node replicas (MOD-18906). RedisBloom needs no equivalent: nothing in this repo starts a cluster-enabled redis of its own — there is no subprocess.Popen in the test tree at all, and the replicas in useSlaves runs are started by RLTest, so the waiver covers them.

@sonarqubecloud

Copy link
Copy Markdown

@LiranAbir
LiranAbir merged commit 7a73dd7 into master Sep 27, 2026
60 of 63 checks passed
@LiranAbir
LiranAbir deleted the MOD-18751-cluster-bus-port-protected-mode branch September 27, 2026 04:22
TalBarYakar added a commit that referenced this pull request Oct 13, 2026
* MOD-17398 CMS Extention (#1063)

* MOD-17398 CMS Extention

* add test

* fixes

* incrby summery change

* opt - cache some values(capped) to skip calculating hash twice in `CMS_IncrBy`

* Undo writes on error instead

* move undo incrs to a function

* cms info rename cell size key (#1064)

* cms info renamke cell size key

* fix test

* MOD-18487 - Reject excessive Bloom filter hash counts during restore (#1067)

* Reject excessive Bloom filter hash counts during restore

* added test which explicitly checks BLOOM_MAX_HASHES

* MOD-18751: waive cluster bus protected mode for the oss-cluster phase (#1068)

* 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).

* Trigger CI to build the image locally, so it installs RLTest 0.7.29

* MOD-18341 - Cap redis-py below 6 so the flow suite keeps a usable client

Nothing here pinned the client, and RLTest's own requirement is uncapped
(redis = ">=5.0.0"), so pip installs redis-py 8.1.0. From redis-py 6 on, a
connection pool carries kwargs that Redis.__init__ does not accept, so the tests
that rebuild a raw client out of an existing pool's connection_kwargs fail:

    raw = redis.Redis(**kwargs)
    TypeError: Redis.__init__() got an unexpected keyword argument 'himport_registry'

That is every build-linux leg on both architectures, on four tests in test_cms
and test_overall. Pin the client to the 5.x series, which is what the previous
RLTest pin was capping it to in effect.

* MOD-18922: drop the bullseye legs from the test matrices (#1069)

Debian 11 reached end of LTS on 2026-08-31, and its packages have rotated off
deb.debian.org/debian-security. The bullseye legs can therefore no longer build
their Docker image whenever the image is built locally rather than pulled (i.e.
on any PR carrying the docker-image-changes label): apt install 404s on the
pinned Debian 11 package versions, and the leg reports no test result at all.

Remove bullseye from the OS lists that drive the test legs only:

  - flow-linux.yml default lists (x64 and arm64) -> Event CI
  - event-nightly.yml (x64 and arm64)
  - flow-random-traffic.yml OS_LIST

The release surface is deliberately left as it was: event-tag.yml and
push-docker-images.yml keep bullseye, so tagged builds still publish a Debian 11
artifact and image. Dockerfile.bullseye and .install/os/bullseye.sh are kept for
the same reason.

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

* MOD-18559 - Fix missing command info for CF.COMPACT (#1071)

* MOD-18559 - Fix missing command info for CF.COMPACT

Adds CF.COMPACT metadata with arity 2, a single read/write key specification, and argument documentation. This lets RAMP packing consume explicit metadata instead of fallback values. Existing command flags remain unchanged.
Adds regression coverage for command metadata, key extraction, argument errors, and successful execution.
Validation: local build and both targeted tests passed. Redis Enterprise proxy routing remains unverified.

* fix linter issue

* MOD-18948: verify every write command replicates to the replica (#1072)

* MOD-18948: verify every write command replicates to the replica

A write command can be implemented correctly on the primary while its
propagation to the replica is wrong or missing, and nothing in the suite
catches it. MOD-16050 is the canonical case: CF.LOADCHUNK replicated only
its header chunk and never the data chunks. The divergence was silent --
master_link_status:up, matching replication offsets, CF.INFO reporting the
full inserted count on both sides -- and only surfaced as total data loss
when a failover promoted the replica.

Add tests/flow/test_replication.py, a table of one representative
invocation per write command (23 of them, covering bf/cf/cms/topk/tdigest).
Each row runs on the primary, waits for the replica to ack, then compares
the key set, the DUMP payload of every key, and a semantic read-back.

The invocation per command is chosen to be the form most likely to diverge
rather than the simplest one: autocreate-on-write instead of a pre-reserved
key, a scaling BF.INSERT instead of a single add, a full SCANDUMP chunk
round-trip instead of a header. No argument permutations.

Two details worth noting:

- topk.add and topk.incrby are exempt from the DUMP comparison. HeavyKeeper
  decays counters with an unseeded rand(), so the replica re-executing the
  same command legitimately ends up with a different internal layout. The
  key set and the value read-backs are still compared.

- A read that returns the type default proves nothing, since both sides
  match trivially. Every row asserts the primary's read-back is non-default
  before comparing it, and asserts WAIT actually acked.

testEveryWriteCommandIsCovered enumerates write commands from the running
server via COMMAND LIST FILTERBY MODULE and fails if any is missing from
the table, so a newly added command cannot land without a replication test.

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

* MOD-18948: skip the replication test on a cluster env

tests.sh runs a `--env oss-cluster` variant, where RLTest's
getSlaveConnection() is an unconditional `raise Exception('unsupported')`.
The test errored there instead of skipping, and since a single failing
variant fails the whole job this reddened every OS leg.

Verified locally against all four tests.sh variants: general, --use-slaves
and --use-aof pass, oss-cluster now skips.

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

---------

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

* MOD-18948: don't start a replica under --use-aof in test_replication (#1073)

Since #1072, arm64 nightly jobs hang in the --use-aof env group until the
360-minute cancel: test_replication reports, and the class that runs next
never does. Bloom has no per-test timeout, so the hang leaves no trace, but
RedisJSON's identical test hit the same group with a 1800 s per-test
timeout, and its traceback shows where it sits: after the test passed,
RLTest stopping the test's replica --

    redis_std.py stopEnv -> _stopProcess(SLAVE) -> process.communicate()

RLTest sends SIGTERM, waits 30 s, then calls communicate() with no timeout.
The same hang predates this test (RedisJSON's test_mset_replication_in_aof,
another replica running with AOF), but in the --use-aof group no other test
starts a replica, so test_replication is what brings one in.

- testWriteCommandsReplicate skips under AOF, before it builds the replica
  env. Replication stays covered by the general and --use-slaves groups.
- testEveryWriteCommandIsCovered no longer asks for a replica at all: it only
  reads the command table, and on RedisJSON it was the test whose teardown
  hung.

Locally, every tests.sh variant passes, and under --use-aof no replica is
started any more.

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

* MOD-19291: bound RLTest teardown and flow test timeouts (#1074)

* MOD-19291: bound RLTest teardown and flow test timeouts

Configure shared Env creation to retry shutdown for 20 seconds before
SIGKILL, preventing stalled replicas from blocking teardown indefinitely.

Add a configurable per-test timeout: 30 minutes by default and 3 hours
under Valgrind.

* increase timeout to vg

* MOD-19365 Use released RLTest 0.7.31 for module tests (#1076)

* if redis does not expose the adress - using hardcoded addr (#1075)

* update version to 8.11.90

---------

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

Labels

docker-image-changes Release a new image containing the latest changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants