Skip to content

v4: prefer the announced hostname when dialing a cluster node (port of #3333) - #3359

Merged
mgravell merged 1 commit into
v4from
marc/v4-announce-dial
Nov 17, 2026
Merged

mgravell merged 1 commit into
v4from
marc/v4-announce-dial

Conversation

@mgravell

Copy link
Copy Markdown
Member

Brings v4 level with main: ca51eb6 (#3333) was the one commit the 3.4.31 intent-merge (#3355) did not cover, having landed on main after it.

Unlike the previous ports, this one is a clean cherry-pick rather than a re-expression: the shadow-topology machinery is shared between the branches (ClusterTopology.cs is byte-identical, and ApplyTopologyGenerationAsync / ReconfigureAsync keep the same structure in v4's ConnectionMultiplexer). I verified the hunks landed inside v4's live ReconfigureAsync path — v4 still refreshes topology through it (UpdateClusterRange(ClusterTopology) + ApplyTopologyGenerationAsync), with RespTopology alongside — so the re-home applies on every topology application here exactly as on main.

What it does (as on main):

  • ClusterTopologyNode.PreferredDialEndPoint: the endpoint form the deployment announced first (cluster-preferred-endpoint-type) — the form TLS can validate, and the one most likely routable from the client.
  • Topology application re-homes a node held by a companion address (typically the pod IP from CLUSTER NODES, Feature Request: Add Automatic ForceReconnect Recovery for Persistent ConnectionMultiplexer Connection Failures #3309) onto its announced hostname: adopted at the exact form (exactForm: true, so the repair does not resolve through the alias being repaired) and the companion server retired through the existing duplicate-merge machinery. Configured seeds are exempt.
  • Discovery creates a SLOTS-listed node at its announced form in the first place, so the common path never creates the companion server at all.

Tests ported with it: PreferredDialEndPointFollowsAnnouncedForm, HostnameAnnouncedShardIsDiscoveredByHostname, ShardHeldByAddressMovesToItsAnnouncedHostname, plus the ApplyTopologyAsync helper. ClusterTopologyUnitTests 17/17 and EndpointResolutionUnitTests 5/5 green locally on net10.0; full library build clean on all TFMs.

After this lands, true drift from main is zero (the ledger's note on rev-list overstating still applies — ancestry is not joined).

)

The one main commit v4 had not absorbed (ca51eb6). The shadow-topology
machinery is shared between the branches - ClusterTopology.cs is
identical and ApplyTopologyGenerationAsync / ReconfigureAsync carry the
same structure - so the cherry-pick applied without conflict; verified
that the hunks landed inside v4's live ReconfigureAsync path and that
the re-home runs on every applied topology here too.

As on main: ClusterTopologyNode gains PreferredDialEndPoint (the form
the deployment announced first); topology application re-homes a node
held by a companion address onto its announced hostname (adopted at the
exact form so the repair does not resolve through the alias being
repaired, retired through the existing duplicate-merge machinery;
configured seeds exempt); and discovery creates a SLOTS-listed node at
its announced form in the first place, so the common path never creates
the companion server at all.

Tests ported with it: PreferredDialEndPointFollowsAnnouncedForm,
HostnameAnnouncedShardIsDiscoveredByHostname and
ShardHeldByAddressMovesToItsAnnouncedHostname, plus the ApplyTopologyAsync
helper. ClusterTopologyUnitTests 17/17 and EndpointResolutionUnitTests
5/5 green on net10.0.
@mgravell
mgravell merged commit 045b757 into v4 Nov 17, 2026
2 of 3 checks passed
@mgravell
mgravell deleted the marc/v4-announce-dial branch November 17, 2026 14:55
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.

1 participant