AlvaroStream opened a new issue, #4917:
URL: https://github.com/apache/bookkeeper/issues/4917
### Motivation
A DistributedLog namespace stores a `BKDLConfig` in ZooKeeper (the data of
the namespace znode, resolved by
`ZkMetadataResolver`). It contains `dlZkServersForWriter/Reader` and
`bkZkServers`/`bkZkServersForReader`.
`BKNamespaceDriver` connects the first ZooKeeper client using the authority
of the namespace URI
(`distributedlog://<zk>/<path>`), then builds the BookKeeper client's
ZooKeeper connection, and, when it differs,
the reader's ZooKeeper client, from the servers stored in that config.
When the ensemble runs in Kubernetes and clients outside the cluster reach
it through a load balancer, the stored
values can be in-cluster service names (for example
`zk-0.zk-headless.ns.svc.cluster.local:2181`). The namespace URI
holds the address the client can reach, but the stored values take
precedence for the BookKeeper and reader
connections, so clients that cannot resolve those names cannot use them.
There is currently no client-side way to
prefer the URI's servers.
The config is read once per namespace URI and cached, so this is decided at
namespace initialization.
### Proposal
Add an opt-in client setting `zkServersIgnorePattern` (default empty,
behavior unchanged). If a stored ZooKeeper
servers value matches the regex, the client uses the ZooKeeper servers of
the namespace URI instead and logs a
warning. It would apply to the DL writer/reader and BK writer/reader values
used by `BKNamespaceDriver`, and to the
reader servers in `ZKMetadataAccessor`.
### Alternatives considered
- Rewriting the stored `BKDLConfig` with reachable names. This works when
one set of names is reachable from every
client, but not when in-cluster and external clients need different names.
--
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]