Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To achieve the old behaviour of using the first resolved IP, add new possible value for client.dns.lookup configuration: "use_first_dns_ips"ip".

Note that this KIP preserves KIP-302 behaviour to only use multiple IPs of the same type (IPv4/IPv6) as the first one, to avoid any change in the network stack while trying multiple IPs.

Proposed Changes

Change ClientUtils#resolve to:

  • If client.dns.lookup value is either "default" or "use_all_dns_ips": Attempt connecting to each resolved IP addresses and use the first one that connects successfully.
  • If client.dns.lookup value is "use_first_dns_ipsip": Use the first resolved IP address.

...

Please note that the concern about breaking SSL hostname verification raised in KIP-235 does not apply to this KIP . The concern was raised because KIP-235 proposed to modify ClientUtils#parseAndValidateAddresses to resolve an address alias (i.e. bootstrap server) into multiple addresses. This would break SSL hostname verification when the bootstrap server is an IP address, i.e. it will resolve the IP address to an FQDN and use that FQDN in the SSL handshake.This this KIP does not propose to modify ClientUtils#parseAndValidateAddresses. This KIP is proposing to only modify ClientUtils#resolve, which is only used in ClusterConnectionStates#currentAddress, to get the resolved InetAddress of an address. And ClusterConnectionStates#currentAddress is only used by NetworkClient#initiateConnect to create InetSocketAddress which is then used in NetworkClient#initiateConnect to establish the socket connection to the broker. In other words, this KIP only change the behaviour of resolving address to the IP address used by the socket to connect to the broker.

...