stevenkang / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Store dupilcate keys after server restart #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I use spymemcached version 2.5
I got the inexpected results when the client run on windows server and on Linux 
server.

The problematic scenario:
1. Run two memcached servers (A and B)
2. Run spymemcached client and call "set" with key="0" and value="blabla" 
(spymemcachedclient.set("0", ttl, "blabla");)
the key was stored in the first cache (A)
3. Stop cache server A
4. Run step 2 (with the same spymemcachedclient instance) - now the key="0" is 
stored in cache server B
5. Run cache server A
THE BUG: 
6. Run spymemcachedclient.get("0") - the return value is null instead of 
"blabla"

I looked at the source code and it seems that spymemcached look for the key 
only in one server which is the primary server or one of the other active 
servers (when the primary is not active) - instead of searching the key in all 
servers untill it found it

Original issue reported on code.google.com by yehud...@gmail.com on 31 Jan 2011 at 3:09

GoogleCodeExporter commented 9 years ago
Is this with the Ketama node locator?  Please specify.

There is a backoff/retry, and it takes some time before the node A would be 
seen again.

Original comment by ingen...@gmail.com on 18 Feb 2011 at 6:37