Repository navigation
Design: Bind Web cluster hostname aliases to existing advertised-endpoint collectors #546
barisdincer
started this conversation in
Design
Replies: 1 comment 1 reply
|
Hi @barisdincer, I really appreciate you writing up this design! It's well written and makes sense. However, I'm going to be taking on this piece of work as part of a larger refactor #552. I will be referencing this design as I write up my own design, so could you do me the favor of reviewing my design once it's out? I'll tag you. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Related issue: #544 — Cluster node hostname aliases do not share advertised-IP metrics collectors
Suggested category: Design
Status: Proposal for maintainer review; implementation has not started.
Problem
In Web mode, a cluster connection can use a hostname while cluster discovery advertises the same node by IP address. Connection identity and metrics collector identity then differ:
node.example.com:6379, DB 0node-example-com-6379-db0192.0.2.10:6379192-0-2-10-6379Removing the DB suffix from the connection ID does not establish which advertised node the hostname represents.
The paths documented in #544 expose two consequences:
Collector-backed Dashboard, Monitor, Activity and configuration paths consequently cannot consistently locate the existing collector.
This proposal addresses hostname/IP alias binding to metrics collectors. The separately reported
Metrics server responded with 500has no confirmed root cause and is not claimed to be resolved by this design.The proposal follows ArgusLi’s feedback on closed PR #545: a binding must follow revalidation and topology changes, and cached client reuse must not transfer another connection’s metrics identity.
The source baseline reviewed is main at
64f5fb4.Invariants
GlideClusterClientis not evidence of a hostname alias’s node identity.Proposed design
The binding model is:
hostname alias → independent node-local probe → native node ID → current topology advertised endpoint → existing endpoint-keyed collectorIdentity sources
Each identity retains its existing purpose:
The native node ID is binding evidence and topology metadata. It does not become a new collector registration key.
Independent alias verification
An alias uses a fresh node-local probe with its connection settings to obtain the identity of the node that actually answers.
CLUSTER MYIDsupplies that node’s native ID.This probe does not use a shared cluster client as identity evidence. A separate DNS lookup performed after connection establishment is also not treated as proof of where that connection went.
The observed native ID must map unambiguously to a usable advertised endpoint in the current topology. Discovery retains primary native IDs as well as replica native IDs. Repeated appearances of the same node across slot ranges are deduplicated; contradictory associations are rejected.
The initial supported mapping contract is the #544 case: a hostname seed maps to a cluster node advertising a usable IP address and port. Unsupported or indeterminate advertised addresses do not trigger a hostname collector fallback.
Shared collector lookup
Collector-backed consumers use a shared backend resolution path:
Connection-scoped response IDs, authorization and DB context remain unchanged.
Monitor state updates reach authorized hostname/IP alias watchers bound to the same collector. Recipient WebSockets are deduplicated without changing their outward connection identity.
Lifecycle
Connect and cached client reuse
Cluster detection and discovery precede collector startup for a Web cluster seed. The independent alias probe establishes the binding, and collector startup uses the resulting advertised endpoint.
Existing cluster transport reuse can remain. Both an exact cache hit and reuse through another connection still require the alias’s own verification; neither inherits an existing alias binding.
An explicitly connected replica can be matched through its native ID. This does not require enabling collectors for every discovered replica.
Refresh, DNS changes and failover
Alias revalidation runs through the existing backend refresh lifecycle, including refreshes where topology compares equal.
A healthy, long-lived probe alone would not observe a changed DNS target. Revalidation therefore establishes a fresh node-local connection using the original alias and connection settings. It publishes a binding only after checking the result against current topology.
Topology refresh updates native-ID-to-endpoint associations, including role changes and replica promotion. Bindings to nodes that disappear or become ambiguous are invalidated.
This provides periodically revalidated node semantics, not an instantaneous DNS-following guarantee.
Retry, reset and asynchronous work
Connect, retry and reset must not rely on an unvalidated inherited binding. Retry revalidates the alias and reads the current collector registration.
An operation retains its intended binding. If revalidation changes the alias to another native node or endpoint, the existing operation fails rather than silently moving to that node. A subsequent operation can use the newly verified binding.
Backend-local revision or equivalent existing-state checks prevent probes and callbacks started before reset, close or a newer refresh from publishing stale results. This is local lifecycle bookkeeping, not a collector wire generation protocol.
When revalidation is required, an unverifiable binding cannot continue dispatching through its previous target.
Collector spawn, registration, ping and close
The existing collector wire protocol remains unchanged:
Closing one alias releases its binding. It does not terminate a collector still required by another alias or by existing collector ownership policy.
Failure behavior
“Fail closed” here means refusing collector-backed dispatch when the binding cannot be verified. It does not redefine successful cluster connectivity as proof of metrics identity.
CLUSTER MYIDunavailable or unauthorizedA successful probe establishes which node answered that probe. It does not prove that every DNS answer for a shared or load-balanced hostname denotes the same node. Such ambiguity must not be hidden by selecting the first DNS address.
Scope and non-goals
The primary scope is Web deployment behavior for #544.
Expected implementation boundaries are:
Consumer changes should route through shared resolution rather than implement separate DNS or identity logic.
Electron and Kubernetes paths require regression analysis and validation because they share backend code. Their existing deployment-specific collector behavior must remain intact. In particular, this proposal does not redesign Kubernetes sidecar identity or require manifest changes.
Other non-goals:
Alternatives considered
run_idmatching and revalidationB* would require validating identity on the connection that executes the operation and handling reconnect/replay correctly. An identity check followed by an operation on a different connection is insufficient. Its Monitor socket feasibility remains an investigation item.
Known limitations and trade-offs
This design does not guarantee operation-time native identity when the same IP:port is reassigned to another native node. A verified binding can become stale before dispatch or reconnect; Monitor can open another connection to that endpoint.
This risk also exists in the current direct-IP collector model. The proposal does not strengthen that transport guarantee and must not claim that it does.
Additional limits:
Testing plan
The following tests are planned after design and implementation approval. They have not been implemented or run for this proposal.
A disposable Web integration environment should exercise a real cluster and controlled hostname changes, including unchanged-topology DNS changes and collector restart. Examples and fixtures will use generic addresses and names.
After implementation, repository-required unit, integration and lint checks will be run. Results will distinguish mocked logic, live integration and deployment-mode evidence. No test result will be presented as resolving the unconfirmed HTTP 500.
Questions for maintainers
CLUSTER MYIDpermission disable collector-backed alias operations while preserving normal cluster connectivity?Requested decision: Approval of this bounded design, or clarification of the guarantees required before implementation begins.
@ArgusLi, could you review this design for #544, particularly the lifecycle guarantees and the explicitly documented operation-time identity limitation?
All reactions