StackExchange / StackExchange/StackExchange.Redis
Cluster: support host names when available, via CLUSTER SLOTS
@mgravell is already working on this.
Since Dec 18, 2024.
- 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 NODESresponse - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.