zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-4956: Provide a HostProvider that uses DNS SRV record for dynamic server discovery

Open li4wang opened this issue 3 months ago • 0 comments

The existing ZooKeeper client architecture relies on StaticHostProvider, which lacks auto service discovery capabilities and must wait for external mechanisms to push server list updates, either through manual configuration changes or reconfig notifications.

This PR provides a HostProvider implementation that performs dynamic service discovery based on DNS SRV record. The following is a summary of the changes:

  1. DnsSrvHostProvider: New HostProvider implementation that performs DNS SRV lookups to discover ZooKeeper servers
  2. HostConnectionManager: Extracted connection management and reconfiguration logic from StaticHostProvider into a reusable component
  3. StaticHostProvider Refactoring: Modified to use HostConnectionManager for consistent connection handling across providers
  4. ConnectionType: New enum that represents the type of connection resolutions
  5. Configuration: Added zookeeper.hostProvider.dnsSrvRefreshIntervalMs client property for DNS refresh intervals

li4wang avatar Sep 27 '25 04:09 li4wang