Open saschat opened 6 years ago
This is because the XMemcachedBuilder
stores the addresses in protected Map<InetSocketAddress, InetSocketAddress> addressMap = new LinkedHashMap<InetSocketAddress, InetSocketAddress>();
. Two InetSocketAddress
with different hostnames that resolve to the same IP hash to the same value.
When I start XMemcached with multiple server strings that point to the same IP XMemcached will just create a single session.
For example if I have
DNS-1
pointing toserver-1
andDNS-2
also pointing toserver-1
XMemcached will create one session toserver-1
. If I later pointDNS-2
toserver-2
and restartserver-1
to bump off the connection XMemcached will only heal the session toserver-1
but not create one toserver-2
.The reason this is important is flexibility. I need to be able to reconfigure servers without having to change the client configuration or restart the client.