AlvaroStream opened a new pull request, #4918:
URL: https://github.com/apache/bookkeeper/pull/4918
Descriptions of the changes in this PR:
Fix #4917
### Motivation
The `BKDLConfig` stored in a DistributedLog namespace carries the ZooKeeper
servers that the BookKeeper client and the
reader 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
- Add `DistributedLogConfiguration#zkServersIgnorePattern`
(`getZkServersIgnorePattern` / `setZkServersIgnorePattern`),
default empty so behavior is unchanged.
- Add `BKNamespaceDriver#selectZkServers`: if a stored ZooKeeper servers
value matches the pattern, use the
namespace 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`.
- Add `TestBKNamespaceDriverZkServers`: unit tests for the selection and
configuration, a baseline read/write, and an
end-to-end read/write against a namespace whose stored BookKeeper
ZooKeeper servers are an unresolvable
`*.svc.cluster.local` name with the pattern set. The same end-to-end test
fails when the pattern is not set.
### What is affected
- **Code:** only `stream/distributedlog/core`. Anything that opens a
DistributedLog namespace through
`BKNamespaceDriver` or `ZKMetadataAccessor` can use the new setting:
client applications, and the modules in this
repo that use the library (`stream/server`, `tools/perf`,
`stream/distributedlog/io/dlfs`).
- **New public interface:** the client configuration key
`zkServersIgnorePattern`. It defaults to empty, so behavior
is unchanged for everyone who does not set it.
- **Not affected:** ZooKeeper and bookies, `bookkeeper-server`, the stored
namespace config (nothing is written and
there is no metadata or wire format change), and clients with and without
the setting can use the same namespace.
- **Not covered:** the admin tools `DistributedLogTool` and `DLAuditor`
still read the stored ZooKeeper servers
directly and ignore the new setting.
### Testing
`mvn -pl stream/distributedlog/core -am test
-Dtest='TestBKNamespaceDriverZkServers,TestDistributedLogConfiguration,TestZkMetadataResolver'`
(20 tests pass, checkstyle passes).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]