Skip to content

Conversation

@marvin-roesch
Copy link
Contributor

@marvin-roesch marvin-roesch commented Aug 5, 2025

New config options:

  • cluster-announce-client-port
  • cluster-announce-client-tls-port

If enabled, clients will always get to see the configured port for a node instead of the internally announced port(s), the same way that cluster-announce-client-ipv4 and cluster-announce-client-ipv6 work. Cluster-internal communication uses the non-client variant of these options.

The configuration is propagated throughout the cluster using new ping extensions.

Closes #2377

@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 62.71186% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.21%. Comparing base (a50690f) to head (df8eaa4).
⚠️ Report is 96 commits behind head on unstable.

Files with missing lines Patch % Lines
src/cluster_legacy.c 62.71% 22 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2429      +/-   ##
============================================
+ Coverage     71.52%   72.21%   +0.69%     
============================================
  Files           123      127       +4     
  Lines         67455    70777    +3322     
============================================
+ Hits          48246    51111    +2865     
- Misses        19209    19666     +457     
Files with missing lines Coverage Δ
src/cluster.c 89.98% <ø> (-0.40%) ⬇️
src/config.c 78.66% <ø> (+0.19%) ⬆️
src/module.c 9.70% <ø> (+0.14%) ⬆️
src/server.h 100.00% <ø> (ø)
src/cluster_legacy.c 87.40% <62.71%> (+0.52%) ⬆️

... and 41 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@madolson madolson added the major-decision-pending Major decision pending by TSC team label Aug 14, 2025
@madolson
Copy link
Member

madolson commented Aug 14, 2025

Viktor from the issue thread:

I like these new configs, but I think we should skip the cluster bus port. The bus is not for clients.

We already have cluster-announce-bus-port that is used together with cluster-announce-ip for the cluster bus.

@marvin-roesch marvin-roesch force-pushed the feat/announce-client-ports branch from abfefc8 to b53821f Compare August 18, 2025 07:26
@marvin-roesch
Copy link
Contributor Author

I went ahead and added an easily reversible commit that removes the bus port announcement change again. The main rationale behind including it in the first place was that the bus port is visible to clients as part of the CLUSTER NODES response.

I'm not sure why the external tests were failing. They ran fine for me locally and I could not see anything related to my changes in the failed test logs.

@marvin-roesch marvin-roesch changed the title Add cluster-announce-client-(port|tls-port|bus-port) configs Add cluster-announce-client-(port|tls-port) configs Aug 18, 2025
@zuiderkwast zuiderkwast added major-decision-approved Major decision approved by TSC team and removed major-decision-pending Major decision pending by TSC team labels Aug 25, 2025
@zuiderkwast zuiderkwast moved this to In Progress in Valkey 9.0 Sep 1, 2025
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

It's a very well-written PR. Thank you. I have only a few comments.

@zuiderkwast zuiderkwast added run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP) cluster release-notes This issue should get a line item in the release notes labels Sep 1, 2025
@marvin-roesch marvin-roesch force-pushed the feat/announce-client-ports branch from 3e981c5 to 1a61f93 Compare September 2, 2025 08:09
@marvin-roesch
Copy link
Contributor Author

I'm not super familiar with Tcl, but from what I could find, the macOS tests might fail due to an old-ish version being installed where lset will not expand a list for the set index to fit. Since the tests don't rely on the indices of the list items, I went for lappend instead.

@zuiderkwast
Copy link
Contributor

I'm not super familiar with Tcl, but from what I could find, the macOS tests might fail due to an old-ish version being installed where lset will not expand a list for the set index to fit. Since the tests don't rely on the indices of the list items, I went for lappend instead.

Sounds reasonable! None of us are TCL experts, but I know the macOS worker runs 8.5 while other workers run 8.6.

@madolson madolson removed this from Valkey 9.0 Sep 3, 2025
@madolson madolson moved this to Todo in Valkey 9.1 Sep 3, 2025
@madolson madolson moved this from Todo to In Progress in Valkey 9.1 Sep 3, 2025
@madolson madolson removed this from Valkey 9.1 Sep 3, 2025
@madolson madolson moved this to In Progress in Valkey 9.0 Sep 3, 2025
Copy link
Member

@madolson madolson left a comment

Choose a reason for hiding this comment

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

Didn't do a deep review, just wanted to check some things we have missed in the past, but it all looked pretty good to me.

Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

The Tcl refactoring looks great.

marvin-roesch and others added 2 commits September 5, 2025 14:04
Co-authored-by: Viktor Söderqvist <[email protected]>
Signed-off-by: Marvin Rösch <[email protected]>
@rjd15372
Copy link
Member

rjd15372 commented Sep 8, 2025

Signed-off-by: Viktor Söderqvist <[email protected]>
@zuiderkwast zuiderkwast merged commit 3b13a7c into valkey-io:unstable Sep 8, 2025
57 of 59 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Valkey 9.0 Sep 8, 2025
@marvin-roesch
Copy link
Contributor Author

Thanks for merging! Sorry about not commenting on that suggestion before. My intention was mostly to avoid repeating conditions, but comparing generated assembly, the compiler at least produced shorter output for the suggested (and now applied) changes.

@zuiderkwast
Copy link
Contributor

My intention was mostly to avoid repeating conditions, but comparing generated assembly, the compiler at least produced shorter output for the suggested (and now applied) changes.

OK, good to know. I didn't check. :) This is not a very hot code path, so we can prefer readability over micro optimizations here.

rjd15372 pushed a commit to rjd15372/valkey that referenced this pull request Sep 19, 2025
New config options:

 * cluster-announce-client-port
 * cluster-announce-client-tls-port

If enabled, clients will always get to see the configured port for a
node instead of the internally announced port(s), the same way that
`cluster-announce-client-ipv4` and `cluster-announce-client-ipv6` work.
Cluster-internal communication uses the non-client variant of these
options.

The configuration is propagated throughout the cluster using new ping
extensions.

Closes valkey-io#2377

---------

Signed-off-by: Marvin Rösch <[email protected]>
Signed-off-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Madelyn Olson <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
rjd15372 pushed a commit that referenced this pull request Sep 23, 2025
New config options:

 * cluster-announce-client-port
 * cluster-announce-client-tls-port

If enabled, clients will always get to see the configured port for a
node instead of the internally announced port(s), the same way that
`cluster-announce-client-ipv4` and `cluster-announce-client-ipv6` work.
Cluster-internal communication uses the non-client variant of these
options.

The configuration is propagated throughout the cluster using new ping
extensions.

Closes #2377

---------

Signed-off-by: Marvin Rösch <[email protected]>
Signed-off-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Madelyn Olson <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
hpatro pushed a commit to hpatro/valkey that referenced this pull request Oct 3, 2025
New config options:

 * cluster-announce-client-port
 * cluster-announce-client-tls-port

If enabled, clients will always get to see the configured port for a
node instead of the internally announced port(s), the same way that
`cluster-announce-client-ipv4` and `cluster-announce-client-ipv6` work.
Cluster-internal communication uses the non-client variant of these
options.

The configuration is propagated throughout the cluster using new ping
extensions.

Closes valkey-io#2377

---------

Signed-off-by: Marvin Rösch <[email protected]>
Signed-off-by: Viktor Söderqvist <[email protected]>
Co-authored-by: Madelyn Olson <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
Signed-off-by: Harkrishn Patro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cluster major-decision-approved Major decision approved by TSC team release-notes This issue should get a line item in the release notes run-extra-tests Run extra tests on this PR (Runs all tests from daily except valgrind and RESP)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[NEW] Announce different ports to clients in cluster

4 participants