Problem with Spy Memcached get method with multi-thread
I start my test of membase, on a 3-node cluster.
The server and client software I installed are membase-server-community_x86_64_1.6.0.rpm, and memcached-2.5.-26-g0c7b5c1.jar.
The testing code looks like:
ArrayList baseURIs = new ArrayList();
URI base = new URI("http://192.168.15.144:8091/pools"); baseURIs.add(base);
base = new URI("http://192.168.15.145:8091/pools"); baseURIs.add(base);
base = new URI("http://192.168.15.146:8091/pools"); baseURIs.add(base);
MemcachedClient mc = new MemcachedClient(baseURIs, "default", "Admin", "Admin", true);
for(int i=0; i<nThreadNum; i++) new testThread().start(); The testThread call mc.get(key) method. Everything is OK with only 1 thread； but with multi-thread , some calls return null and I get message: "WARN net.spy.memcached.protocol.binary.OptimizedGetImpl: Error on key key00000681: I'm not responsible for this vbucket (7)"However, there's no problem if the testThread calls set or delete method. As far as I know, Spy Memcached works with 1 non-blocking connectione to every server node, the MemcachedClient ought to be thread safe.Probably I have not found the right way of using Spy Memcached. Any ideas ? It's very appreciated if you can show me the right approach of using Spy Memcached :)