Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not collapse multiple servers when they resolve to the same IP #78

Open
saschat opened this issue Apr 10, 2018 · 1 comment
Open

Comments

@saschat
Copy link
Contributor

saschat commented Apr 10, 2018

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 to server-1 and DNS-2 also pointing to server-1 XMemcached will create one session to server-1. If I later point DNS-2 to server-2 and restart server-1 to bump off the connection XMemcached will only heal the session to server-1 but not create one to server-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.

@saschat
Copy link
Contributor Author

saschat commented Apr 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant