Skip to content

Fix hostname-preferred cluster reconnects - #3346

Closed
meerasridharan-28 wants to merge 3 commits into
seredis:mainfrom
meerasridharan-28:fix_cluster_sni_hostname
Closed

meerasridharan-28 wants to merge 3 commits into
seredis:mainfrom
meerasridharan-28:fix_cluster_sni_hostname

Conversation

@meerasridharan-28

Copy link
Copy Markdown

When CLUSTER SLOTS announces a shard hostname while CLUSTER NODES reports its companion IP, StackExchange.Redis could adopt or reconnect through the IP. In deployments that route one shared DNS endpoint using TLS SNI, that can prevent reconnection after topology changes.

This change resolves known servers consistently across topology refreshes, refreshes aliases to the server selected by the current topology, and tracks the preferred dial endpoint for reconnects, TLS host/SNI, and tunnels. It preserves IP dialing when the topology prefers an IP. Regression coverage includes both pre-seeded endpoints and discovery from a single seed.

Validation: dotnet test --project tests/StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj -c Release -f net10.0 --filter-class StackExchange.Redis.Tests.ClusterTopologyUnitTests — passed (16 tests).

Checklist

  • I fully and freely contribute this code in accordance with the project license (and am legally able to do so)
  • I take responsibility for this contribution's quality and correctness, including any portions produced with AI assistance (see CONTRIBUTING.md).

meerasridharan-28 and others added 3 commits November 10, 2026 16:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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