fix: resolve control node endpoint for ClientRoutes contact point matching#843
Draft
dkropachev wants to merge 1 commit intoscylladb:scylla-4.xfrom
Draft
Conversation
…tact point matching With ClientRoutes, contact points use DefaultEndPoint (discovery proxy) while discovered nodes use ClientRoutesEndPoint (keyed by host_id). These endpoint types never match via equals(), causing InitialNodeListRefresh to fail to match the contact point to the system.local node, resulting in a spurious remove+add cycle. Add TopologyMonitor.getChannelNodeInfo(channel) API that queries system.local and returns the proper endpoint for the connected node. ControlConnection calls this after each successful connect() and updates the channel's endpoint via DriverChannel.setEndPoint(). For ClientRoutes, this upgrades the channel from DefaultEndPoint to ClientRoutesEndPoint. InitialNodeListRefresh then matches the control node by endpoint equality and falls back to the first unmatched contact point. If the system.local query fails, the control connection retries the next node. Fixes: scylladb#841
f934b03 to
a040c57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DefaultEndPoint(discovery proxy) while discovered nodes useClientRoutesEndPoint(keyed by host_id). These types never match viaequals(), causingInitialNodeListRefreshto emit spurious remove+add events for the control node.TopologyMonitor.getChannelNodeInfo(channel)API that queriessystem.localand returns the proper endpoint for the connected nodeControlConnection.connect()calls this after each successful connection and updatesDriverChannel.setEndPoint()— for ClientRoutes this upgrades fromDefaultEndPointtoClientRoutesEndPointInitialNodeListRefreshmatches the control node by endpoint equality against the (now-upgraded) channel endpoint, falling back to the first unmatched contact pointsystem.localquery fails, the control connection retries the next nodeTest plan
ClientRoutesITintegration test against ScyllaDB Enterprise 2026.1