Skip to content

feat(server-ng): add cluster.nodes.advertised_address for clients - #3757

Merged
spetz merged 6 commits into
masterfrom
advertised_ip
Jul 28, 2026
Merged

feat(server-ng): add cluster.nodes.advertised_address for clients#3757
spetz merged 6 commits into
masterfrom
advertised_ip

Conversation

@mmodzelewski

@mmodzelewski mmodzelewski commented Jul 27, 2026

Copy link
Copy Markdown
Member

A node's ip is the address it binds for replica traffic, which in
Docker, Kubernetes, or NAT deployments is private. Both client-facing
surfaces reuse it: the cluster roster returned to clients and the
follower's redirect to the metadata primary. Clients outside the
replica network get an address they cannot reach.

Nodes now take an optional advertised_address that overrides ip
only where an address is handed to a client. Replica traffic still
uses ip, so the two planes can live on separate networks. Left
unset, behavior is unchanged.

The value parses into an AdvertisedAddress: a literal IP or an
RFC 1123 hostname, rejecting ports, empty labels, and dotted-numeric
strings that are really malformed IPv4, so 10.0.0.256 fails at boot
instead of reaching DNS. Hostnames normalize to lowercase and IPs to
canonical form, so textual variants of one address compare equal and
publish identically; IPv6 hosts are bracketed when rendered with a
port.

Validation now also checks advertised client endpoints for conflicts
alongside the existing bind-endpoint check, since two nodes on
distinct private IPs can otherwise publish the same client address
and silently shadow each other. Only client transports take part,
as replica ports never carry an advertised address. A roster ip
that parses as neither IP nor hostname stays legal (Docker service
names with underscores exist in the wild) and falls back to
raw-string comparison instead of failing boot.

Node entries also reject unknown fields, so a misspelled
advertised_address fails at startup instead of silently leaving the
private ip in client responses.

A node's `ip` is the address it binds for replica traffic, which in
Docker, Kubernetes, or NAT deployments is private. Both client-facing
surfaces reuse it: the cluster roster returned to clients and the
follower's redirect to the metadata primary. Clients outside the
replica network get an address they cannot reach.

Nodes now take an optional `advertised_address` that overrides `ip`
only where an address is handed to a client. Replica traffic still
uses `ip`, so the two planes can live on separate networks. Left
unset, behavior is unchanged. The field is typed as a string but
validated as a literal IP, leaving room to accept hostnames later
without a config-format break.

Validation now checks advertised client endpoints for conflicts
alongside the existing bind-endpoint check, since two nodes on
distinct private IPs can otherwise publish the same client address
and silently shadow each other. Node entries also reject unknown
fields, so a misspelled advertised_address fails at startup
instead of silently leaving the private ip in client responses.
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 27, 2026
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.35165% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.55%. Comparing base (ab944b5) to head (ac11d63).

Files with missing lines Patch % Lines
core/configs/src/server_ng_config/cluster.rs 98.91% 3 Missing ⚠️
core/server-ng/src/http/error.rs 92.30% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3757       +/-   ##
=============================================
- Coverage     74.58%   60.55%   -14.04%     
  Complexity      969      969               
=============================================
  Files          1306     1305        -1     
  Lines        150282   138231    -12051     
  Branches     125715   113738    -11977     
=============================================
- Hits         112088    83703    -28385     
- Misses        34690    50941    +16251     
- Partials       3504     3587       +83     
Components Coverage Δ
Rust Core 57.75% <98.35%> (-17.15%) ⬇️
Java SDK 62.71% <ø> (ø)
C# SDK 71.13% <ø> (-1.13%) ⬇️
Python SDK 92.27% <ø> (ø)
PHP SDK 84.52% <ø> (ø)
Node SDK 92.24% <ø> (+0.12%) ⬆️
Go SDK 43.08% <ø> (ø)
Files with missing lines Coverage Δ
core/configs/src/server_ng_config/defaults.rs 100.00% <100.00%> (ø)
core/configs/src/server_ng_config/validators.rs 78.93% <100.00%> (+0.06%) ⬆️
core/server-ng/src/bootstrap.rs 16.02% <100.00%> (+0.04%) ⬆️
core/server-ng/src/cluster_meta.rs 77.77% <100.00%> (+61.90%) ⬆️
core/configs/src/server_ng_config/cluster.rs 96.74% <98.91%> (+1.88%) ⬆️
core/server-ng/src/http/error.rs 56.88% <92.30%> (+5.43%) ⬆️

... and 261 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.

hubcio
hubcio previously approved these changes Jul 27, 2026
hubcio
hubcio previously approved these changes Jul 27, 2026
numinnex
numinnex previously approved these changes Jul 27, 2026
@mmodzelewski
mmodzelewski dismissed stale reviews from numinnex and hubcio via 99b9b6d July 28, 2026 05:06
@spetz
spetz merged commit cfa104c into master Jul 28, 2026
94 checks passed
@spetz
spetz deleted the advertised_ip branch July 28, 2026 06:59
@github-actions github-actions Bot removed the S-waiting-on-review PR is waiting on a reviewer label Jul 28, 2026
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.

4 participants