Implement resolve_canonical_bootstrap_servers_only #2156
Merged
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.
This PR allows specifying the equivalent of
client.dns.lookup=resolve_canonical_bootstrap_servers_only
, described in KIP-235. The motivation is identical to the one in the proposal: the lack of this feature effectively mandates providing individual canonical broker hostnames when using GSSAPI, rather than a single alias which resolves to the same underlying IPs. This increases the likelihood of errors, and commits application owners to checking for new and removed brokers on an ongoing basis.The Java client implementation for this can be found here.
The config could be designed as a
type DNSLookupStrategy int8
enum, withUseAllDNSIPs
andResolveCanonicalBootstrapServersOnly
values, however I went for thebool
as there is no precedent for mirroring the Java API, and this seemed much simpler to understand.I was torn about adding
context.Context
toresolveCanonicalNames()
's signature. To be consistent with existing code, I've kept this internal. It is not fully supported anyway due toNet.Proxy.Dialer
being aproxy.Dialer
rather thanproxy.ContextDialer
.