StackExchange / StackExchange/StackExchange.Redis

Cluster: support host names when available, via CLUSTER SLOTS

Open
#2,826 10 comments 1 reaction 1 assignee View on GitHub

@mgravell is already working on this.

Since Dec 18, 2024.

⚙️ area:connection
Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Situation:

  • especially from v7, cluster shards may be routed via hosts instead of IPs
  • thus, the advertised IPs may sometimes (with known examples) may not be routable
  • SLOTS and SHARDS (v7+) provide the hosts; NODES does not, as far as known

Proposal:

  • prefer SLOTS to NODES (but not SHARDS due to v7 dependency)
  • route via hostname when available, IP otherwise
  • possibly with option to use fallback old behaviour?

Was: "Lookup by endpoint should check IP and host"

Currently, only exact endpoint matches are considered. However, specially in the case of CLUSTER, a node may have both host and IP evidently. Further, -MOVED may return the unexpected option, leading to additional connections.

We should:

  • record both identities as declared, for example from the CLUSTER NODES response
  • if no equality endpoint match is found, check also using the best data available (after type-testing the endpoint)

Context: https://github.com/dotnet/aspnetcore/issues/59211

Auxiliary consideration: should cluster routing be limited to IP, as current? Should there be a "use host routing" option? Or should we try IP and use host if that fails?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.