Repository navigation
Issue #4917: DistributedLog: allow ignoring unresolvable ZooKeeper servers stored in the namespace config - #4918
Closed
AlvaroStream wants to merge 1 commit into
Closed
AlvaroStream wants to merge 1 commit into
AlvaroStream wants to merge 1 commit into
Conversation
…in the namespace config The namespace config stored in ZooKeeper (BKDLConfig) carries the ZooKeeper servers that the DistributedLog and BookKeeper clients connect to. When the ensemble runs in Kubernetes and clients reach it through a load balancer, these stored values can be in-cluster service names that clients outside the cluster cannot resolve, while the namespace URI holds the address they can reach. Add an opt-in configuration key, zkServersIgnorePattern (default empty, so behavior is unchanged). When a stored ZooKeeper servers value matches the regex, the client uses the ZooKeeper servers of the namespace URI instead. Applied to the DL writer/reader and BK writer/reader values read by BKNamespaceDriver, and to the reader ZooKeeper servers in ZKMetadataAccessor. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closed, I tried to reproduce the issue locally and it was not possible. This won't resolve the problem. |
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.
Descriptions of the changes in this PR:
Fix #4917
Motivation
The
BKDLConfigstored in a DistributedLog namespace carries the ZooKeeper servers that the BookKeeper client and thereader ZooKeeper client connect to. When these are in-cluster service names that a client outside the cluster cannot
resolve, while the namespace URI holds a reachable address, the client has no way to prefer the URI's servers.
See #4917 for details.
Changes
DistributedLogConfiguration#zkServersIgnorePattern(getZkServersIgnorePattern/setZkServersIgnorePattern),default empty so behavior is unchanged.
BKNamespaceDriver#selectZkServers: if a stored ZooKeeper servers value matches the pattern, use thenamespace URI's servers instead and log a warning. Applied to the DL writer/reader and BK writer/reader values, and
to the reader servers in
ZKMetadataAccessor.TestBKNamespaceDriverZkServers: unit tests for the selection and configuration, a baseline read/write, and anend-to-end read/write against a namespace whose stored BookKeeper ZooKeeper servers are an unresolvable
*.svc.cluster.localname with the pattern set. The same end-to-end test fails when the pattern is not set.What is affected
stream/distributedlog/core. Anything that opens a DistributedLog namespace throughBKNamespaceDriverorZKMetadataAccessorcan use the new setting: client applications, and the modules in thisrepo that use the library (
stream/server,tools/perf,stream/distributedlog/io/dlfs).zkServersIgnorePattern. It defaults to empty, so behavioris unchanged for everyone who does not set it.
bookkeeper-server, the stored namespace config (nothing is written andthere is no metadata or wire format change), and clients with and without the setting can use the same namespace.
DistributedLogToolandDLAuditorstill read the stored ZooKeeper serversdirectly and ignore the new setting.
Testing
mvn -pl stream/distributedlog/core -am test -Dtest='TestBKNamespaceDriverZkServers,TestDistributedLogConfiguration,TestZkMetadataResolver'(20 tests pass, checkstyle passes).