anmolnar commented on PR #2338:
URL: https://github.com/apache/zookeeper/pull/2338#issuecomment-3549344229

   > This code has been this way as long as I can remember - it seems like it 
could have a significant impact to existing functionality/expectations. eg how 
do we know that every dns provider will behave as you expect. I would imagine 
something like this behind a config option, release notes and documentation 
would be less risky.
   
   That's good point. Currently there're two issues with this code.
   1. ZooKeeper client doesn't care about `java.net.preferIPv6Addresses` 
setting and picks randomly from the resolved IP addresses regardless of IP 
version.
   2. Choosing completely randomly from the returned addresses also ignores 
[DNS round robin](https://en.wikipedia.org/wiki/Round-robin_DNS) implementation 
if present.
   
   Now both issues are covered by the patch, but if we want to make this 
optional, which part shall we introduce a config setting?
   
   1. Introduce `zookeeper.groupDnsResponse` (false by default) and group DNS 
response by address type and choose randomly from the preferred group.
   2. Introduce `zookeeper.shuffleDnsResponse` (true by default) and keep the 
original behavior completely if set to true.
   3. Combine the previous two options and introduce both settings to control 
the two different behaviors individually.


-- 
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]

Reply via email to