Found via unit test + a random luck that the IPs returned by localhost look up via net.LookupIP happens to return ipv4 in front of ipv6 address.
Essentially if the golang call of net.LookupIP returns addresses in a list and the IPv4 address is in the front of the list, and IPv6 only mode is in place, XDCR will return an invalid IPv6 address of:
We haven't seen this in the field yet probably because not many people are using IPv6 only mode, and considering that Capella currently uses IPv4 only mode.
However, if IPv6 only mode is ever used, this could lead to continuous HA outages as the MyConnectionStr() method is used throughout the code as a remote cluster reference string getter.
|Running ipv6 only mode + non-encrypted remote resulted in invalid IP addresses being returned leading to connection issues.
|A valid IP address is now returned.
|For Gerrit Dashboard: MB-57412
|MB-57412: ipv6 only mode could return invalid IPv6 address