Repository navigation
feat: try every address a contact point resolves to (DRIVER-201) - #1074
Conversation
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Advanced Run ID: 📒 Files selected for processing (13)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
650e41c to
aee0480
Compare
5d325b7 to
9dd3b25
Compare
dc69c16 to
bdb3844
Compare
A contact point given as a hostname was one connect: whatever address Netty's resolver returned first. A dead first record failed build(), and the fallback re-tried one address per round. When the control connection reaches such a contact point it now resolves the name to all its addresses (ChannelFactory.resolveAll) and tries each as its own temporary node labelled hostname/ip:port, so AllNodesFailedException names every address. That first address still goes first, so expanding can never do worse; the rest follow shuffled, capped at advanced.connection.max-candidate-addresses. The node reached is registered under the address it answered on. Fixes scylladb#989 Fixes scylladb#1072 Refs: scylladb#890 Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
bdb3844 to
2589b9f
Compare
Code Review by Qodo
🔴 High 1.
|
A bootstrap hook that throws left an expansion round unsettled: the callback logged the escape and returned, so init() waited for ever and a Reconnection stayed stuck on an attempt that never completed. ChannelFactory.connect now fails its future rather than throwing at its caller, and the expansion callback ends the round if anything still escapes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The candidate order rested on getByName being getAllByName[0], which reads as an API coincidence and invited the question of what happens when a resolver disagrees. Name what actually ranks the list: getaddrinfo sorts destinations per RFC 6724 and the JVM regroups them once, so element 0 is the platform's choice for this client. A resolver that randomises instead randomises resolveAll too, so pinning its first answer costs nothing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x. At 4.19.0 a hostname contact point is tried at its first address only (scylladb#1074 is newer), and there is no subnet translator, so reword both and drop the links to sections this branch lacks. Backport the fixed proxy hostname section the new pages point to. Use the eval_rst toctree this branch is built with, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x, where a hostname contact point expands to several addresses (scylladb#1074). 4.19.2 tries only the first address a lookup returns, so say that and drop the links. Carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x. At 4.19.0 a hostname contact point is tried at its first address only (scylladb#1074 is newer), and there is no subnet translator, so reword both and drop the links to sections this branch lacks. Backport the fixed proxy hostname section, and carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x. At 4.19.0 a hostname contact point is tried at its first address only (scylladb#1074 is newer), and there is no subnet translator, so reword both and drop the links to sections this branch lacks. Backport the fixed proxy hostname section, and carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x, where a hostname contact point expands to several addresses (scylladb#1074). 4.19.2 tries only the first address a lookup returns, so say that and drop the links. Carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x, where a hostname contact point expands to several addresses (scylladb#1074). 4.19.2 tries only the first address a lookup returns, so say that and drop the links. Carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x. At 4.19.0 a hostname contact point is tried at its first address only (scylladb#1074 is newer), and there is no subnet translator, so reword both and drop the links to sections this branch lacks. Backport the fixed proxy hostname section, and carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
scylladb#1130 was written against scylla-4.x. At 4.19.0 a hostname contact point is tried at its first address only (scylladb#1074 is newer), and there is no subnet translator, so reword both and drop the links to sections this branch lacks. Backport the fixed proxy hostname section, and carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
* docs: add a connectivity section to the core manual (#1130) How an application reaches a cluster had no home in the manual. Client routes were an H3 inside Address resolution, so the site had no URL and no search result of its own for them, and nothing covered VPC peering, Transit Gateway or direct connections at all. Add manual/core/connectivity/ with an index routing each kind of network to what the driver needs, a page on the cases that need no translation, and the client routes content moved out of Address resolution. The old heading stays as a pointer so the 3.x deep link keeps resolving. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 9167ca1) * docs: fit the connectivity section to 4.19.0 #1130 was written against scylla-4.x. At 4.19.0 a hostname contact point is tried at its first address only (#1074 is newer), and there is no subnet translator, so reword both and drop the links to sections this branch lacks. Backport the fixed proxy hostname section, and carry the sibling ports' fixes: Cloud TLS on 9142 with the cluster CA, rpc_address in the local query, qualified client routes pointers, and DNS lookups on the admin threads. Use the eval_rst toctree, and name the client_routes/clientroutes spellings for search. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * docs: enable TLS in the ScyllaDB Cloud connection example The example connected to 9142, the TLS port, without enabling TLS, and the truststore setup came only afterwards as a HOCON block, so the code copied as shown fails to connect. Configure the engine factory in the builder and keep the HOCON block as the application.conf alternative. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
A contact point given as a hostname was one connection attempt, to whatever address Netty's resolver returned first: a dead first record failed
CqlSession.build()(DRIVER-201), and the reconnection fallback from #1065 re-tried one address per round.ChannelFactory.resolveAll, feat: add resolveAll through Netty's configured resolver (DRIVER-201) #1073) and deduplicated. The address the resolver returns first is tried first — that is where a connect would have gone on its own, so expanding a name can never do worse than not expanding it — and up toadvanced.connection.max-candidate-addresses - 1of the others follow in random order (5 addresses in all by default). The cap bounds what one contact point costs a round; shuffling the rest makes a capped set that missed the live nodes a different set next round.cluster.example.com/10.0.0.1:9042, ahead of the rest of the plan.AllNodesFailedExceptioncarries one entry per address; TLS and authentication keep seeing the configured name.EndPoints and identified nodes are tried as before. A resolver failure or an unusable answer falls back to today's single connect.resolve()resolved,toString()/nodetag gain/ip, prefix, TLS and auth name unchanged; its pool stops re-resolving the name). That is the labelled form of 4.x: the node reached through a contact-point hostname is registered under that hostname, which can later resolve to another node #1072, documented in the upgrade guide.Verified:
ControlConnectionTest+15 (9 red against the code they guard, 6 pin unchanged paths), fullcoresuite (4102) green on JDK 11, docs build;MockResolverITagainst ScyllaDB 2026.1.9 including the dead-first-record case. Not covered locally: the Cassandra CCM lanes.Sits on
scylla-4.xdirectly, one commit, now that #1073 has merged.Fixes #356
Fixes #989
Fixes #1072
Refs: #890
🤖 Generated with Claude Code