feat: add resolveAll through Netty's configured resolver (DRIVER-201) - #1073
Draft
nikagra wants to merge 2 commits into
Draft
feat: add resolveAll through Netty's configured resolver (DRIVER-201)#1073nikagra wants to merge 2 commits into
nikagra wants to merge 2 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
nikagra
force-pushed
the
s2/06-resolve-all
branch
from
September 9, 2026 22:12
55e75dc to
821a6ab
Compare
nikagra
force-pushed
the
s2/06-resolve-all
branch
2 times, most recently
from
September 10, 2026 12:37
68cd417 to
e89f06c
Compare
The driver reconnects on addresses it resolved once and never re-reads DNS (scylladb#215). Default `fallback-to-original-contact-points` to true: once a reconnection round has exhausted the live nodes, the retained unresolved contact points are tried again, so their names are resolved afresh. Init and fallback build that plan through one path. isControlNode matches the pending node by reference and re-checks the identified node, because the endpoint equals() was a blocking lookup per event with unresolved placeholders in the plan. A new MockResolverIT case covers recovery to new addresses. Fixes scylladb#215 Refs: scylladb#890 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChannelFactory.resolveAll(SocketAddress) asks the resolver the driver's bootstrap would use for a connect, so a custom AddressResolverGroup installed through NettyOptions.afterBootstrapInitialized is honoured, for every address a name currently maps to. It mirrors Netty's own short-circuits (disabled resolver, unsupported or already-resolved address: the input as is). AddressResolver#resolveAll resolves inline, so the lookup runs on one pinned I/O loop, never on the caller; the hook is asked once. No caller yet: the contact-point expansion follows. Refs: scylladb#890 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
nikagra
force-pushed
the
s2/06-resolve-all
branch
from
September 10, 2026 23:03
e89f06c to
c49f5cf
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.
Groundwork for expanding a contact-point hostname to every address it resolves to (next PR in the stack): nothing in the driver can ask Netty's configured resolver for all the addresses of a name, only for one, and only inside
Bootstrap.connect().ChannelFactory.resolveAll(SocketAddress)builds a bootstrap the wayconnect()does, runsNettyOptions.afterBootstrapInitializedon it, and asks the resolver that hook left installed, so a customAddressResolverGroupis honoured.AddressResolver#resolveAllresolves inline, and the default resolver blocks on the JDK lookup. A connect already pays that on an event loop, so this is parity, and the admin executor is left free.bootstrap.resolver(new DnsAddressResolverGroup(...))would otherwise mint a resolver, a socket and an empty DNS cache every time.connect().Verified:
ChannelFactoryResolveAllTest(13 cases), the thread and hook-count cases proven red against the pre-change file; every existingChannelFactory*Testunmodified and green; fullcoreunit suite green (3981) on JDK 11. Not covered: no integration test — the caller in the next PR carries those.Stacked on #1065 (
s2/05-fallback-default); the first commit here is that PR's.Refs: #890, #215
🤖 Generated with Claude Code