-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Problem when a memcached server changes IP address #68
Comments
I will look into it, thanks. |
Is there any progress on this issue? |
I am sorry , i didn't have too much time on this project in these days, but i will try to look into it this weekend. |
I've fixed this issue, it happens in failure mode, the new release will be delivered ASAP. |
Released 2.4.2, it may takes sometime to be synced into maven central repo. https://github.com/killme2008/xmemcached/releases/tag/xmemcached-2.4.2 |
I am not convinced this is fixed. I just tried out version 2.4.2 both with
Note: I use the binary protocol with authentication. Could it be that XMemcached does not authenticate with the new server? |
@saschat do you make sure the DNS changes take effect at your client machine? And JVM has DNS cache, you may have to disable it , see https://stackoverflow.com/questions/1256556/any-way-to-make-java-honor-the-dns-caching-timeout-ttl |
@killme2008 yes, the DNS changes take effect. See the log message I posted above. It removes the session with IP 52.57.227.183 and then adds a session with IP 52.59.110.98. |
@saschat It looks that the client has resolved the server to new IP address and connect to it, but the connection was lost again. If you doubt it was an authentication problem, can you try it without the authentication? |
That will be difficult. I work for MemCachier and we do not operate servers without authentication. Note that it is not an authentication problem in the sense that the credentials do not work. If I restart the app it connects (and authenticates) to the new server. I think that maybe when XMemcached is trying to heal the session it does not authenticate or has a different problem regarding authentication. The reason I say that is because when I connect to the server the first time I get a log message that it authenticated before it adds the session. Here is the log message for a normal operation:
But in the logs I posted earlier there is no message regarding authentication. |
@saschat All right, i will try to reproduce it in my machine this weekend or later, but it may take sometime, i am really busy in these days, sorry. |
@killme2008 Thanks! I will also look into it and if I figure it out I will submit a PR. |
@killme2008 I found the bug. I will try to find a good way to solve it and submit a PR. |
@saschat Great! welcome to submit a PR. |
…n allowing disabling address resolution
This issue appears again due to a minor bug in initialization order ( see my pr) #129 |
We have to configure our client with
failureMode=true
, and we are getting errors like this when a memcached server gets down and comes back with a different IP:The old IP was
192.168.1.41
and the new one is192.168.1.44
. When the server recovers with the new IP we can see logs like:However, the client is still using sessions with the old IP that are closed.
I have been debugging a bit and found that in the class
net.rubyeye.xmemcached.impl.MemcachedConnector
there is an attribute calledsessionMap
that contains sessions with both the old and new IP, because the new sessions do not override the old ones, and then all those sessions are passed to the session locator in the methodupdateSessions()
. I think the session locator should receive only the sessions with the new IP.Please could you take a look?
The text was updated successfully, but these errors were encountered: