Skip to content

Waive cluster bus port protection for servers that support it (with tests) - #573

Merged
fcostaoliveira merged 3 commits into
redis-performance:masterfrom
oshadmi:fix/cluster-bus-port-protected-mode
Oct 23, 2026
Merged

fcostaoliveira merged 3 commits into
redis-performance:masterfrom
oshadmi:fix/cluster-bus-port-protected-mode

Conversation

@oshadmi

@oshadmi oshadmi commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Builds on #572 (@Itzikvaknin), whose commit is kept as-is at the base of this branch.

Problem

Recent Redis refuses to start a non-TLS cluster node unless
cluster-bus-port-protected-mode is set to no. Benchmarks that build Redis from
unstable (--redis-server-binary / redis_ref) fail at cluster startup. The fatal
error goes to stdout and leaves an empty logfile. Servers that predate the directive
abort on it, so it can't be passed unconditionally.

Approach (from #572)

The remote cluster path probes the redis-server binary for the directive name and passes
--cluster-bus-port-protected-mode no only when the binary contains it. The flag goes
before configuration_parameters, so an explicit value in a spec still wins.

What this PR adds on top

  • spin_up_local_redis_cluster (run-local) had the same startup failure. It now passes
    the waiver when the local binary contains the directive.
  • The remote probe is its own function, remote_binary_supports_cluster_bus_port_protected_mode.
    It logs a warning when the probe exit status is neither 0 (found) nor 1 (not found),
    for example an SSH failure or a missing binary. In that case it falls back to no waiver.
  • Tests: the waiver is absent by default, an explicit spec value comes after the waiver,
    the local binary check, and the remote probe's handling of exit statuses 0, 1, 2 and -1.

Notes

  • The probe is a string match. It shows the name is present in the binary, not that the
    directive is recognised.
  • tests/test_defaults_purpose_built_env.py::test_dry_run_* fail on the base commit as
    well, and tests/test_compare.py fails at collection there. These are unrelated to
    this change.

🤖 Generated with Claude Code

Itzikvaknin and others added 2 commits October 22, 2026 11:24
Redis now refuses to start a cluster node with tls-cluster disabled unless
cluster-bus-port-protected-mode is explicitly set to no. No benchmark sets
tls-cluster, so every remote oss-cluster run failed at startup with only a
ping timeout to show for it.

- Servers that predate the config abort on it as an unknown directive, so the
  remote spin-up greps the binary the DB host will run for the config name
  and only passes --cluster-bus-port-protected-mode no when it is there.
- The waiver goes ahead of configuration-parameters: redis-server keeps the
  last value of a repeated option, so a benchmark's explicit setting still wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add unit tests for the waiver argument (absent by default, an explicit spec
value still comes last) and for the remote probe's exit-status handling,
extract the remote probe into a helper that warns on SSH/path failures,
and apply the same support check to spin_up_local_redis_cluster.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@oshadmi

oshadmi commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@paulorsousa @fcostaoliveira could you review? The 8.12 RC1 benchmarks (redis-ref pointing at unstable) fail at cluster startup on cluster-bus-port-protected-mode and are blocked on this fix. It builds on #572 and adds tests, local run-local coverage and probe warnings. Merging and releasing it today would let us rerun them.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 Automated first-pass review. A human maintainer still needs to review this before merge.

LGTM. Here's what I checked:

  • Remote probe ordering. In spin_up_redis_cluster_remote_redis, the probe runs after the custom binary is copied and chmod +x'd. So when --redis-server-binary is used, it greps the binary that will actually be launched. It runs once per cluster, outside the per-shard loop, so it adds one SSH round-trip and not N.
  • Precedence. The waiver is added to the arguments before configuration_parameters. A spec that sets cluster-bus-port-protected-mode explicitly still wins, and test_cluster_bus_port_protected_mode_explicit_value_comes_last pins that.
  • Positional-arg compatibility. waive_cluster_bus_port_protection is added as the last kwarg and defaults to False. The two existing positional callers (local and remote) are both updated, and any other caller keeps today's behaviour.
  • Failure modes. Both probes fall back to "no waiver" when they hit trouble: the local one on an unresolvable path or an OSError, the remote one on any non-0/1 grep status. Old servers therefore never get an unknown directive, and the unreadable-binary and quoted-path cases have tests.

A few non-blocking notes:

  1. The local probe does f.read() on the whole binary. That's fine for a normal redis-server, but sanitizer or debug builds can be much larger. Reading in chunks would avoid loading it all, though I don't think it matters in practice.
  2. As the description says, the check is a string match. A binary that contains the name but rejects the directive would still fail at startup. Since stdout goes nowhere useful on that path, the Passing/Not passing ... (probe exit status N) info line is the main clue when this goes wrong, and it's good that it's there.
  3. The version bump to 0.12.41 is bundled here rather than in a separate bump PR. That's fine if the plan is to release right after merge. Per AGENTS.md, it just means the release step follows this merge directly.

The description says the test_dry_run_* failures and the test_compare.py collection error also happen on the base commit. That matches the "CI red for unrelated reasons" situation this repo has explicitly waved through before, but it's worth someone confirming on CI rather than taking it on trust.

Nice fix, with good test coverage of the probe edge cases.

- local probe: catch OSError on open/read (permission denied, directory on PATH) and fall back to no waiver, so run-local no longer aborts and the docstring's "unresolvable counts as unsupported" contract holds
- remote probe: shlex.quote the redis-server binary, so a remote_redis_server_path with spaces or shell metacharacters no longer makes the probe fail and silently drop the waiver
- reword the remote probe warning: execute_remote_commands raises on SSH connect failures before any exit status, so a non-0/1 status means the binary was not found or unreadable
- add regression tests for the unreadable binary and the quoted path
- bump version 0.12.40 -> 0.12.41 for release

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@fcostaoliveira fcostaoliveira left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Applied the first-pass review follow-ups in 668af23 (OSError fallback in the local probe, shlex.quote in the remote probe, clearer warning text, plus regression tests) and bumped to 0.12.41 for release. LGTM.

@fcostaoliveira
fcostaoliveira merged commit ab8d879 into redis-performance:master Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants