Updates:
        Status: Invalid

Comment #2 on issue 229 by [email protected]: memcached Counter
http://code.google.com/p/memcached/issues/detail?id=229

What client is this with?  I think it may be something rather ancient.

With the Whalin Memcached-Java-Client, and this (more correct) code, I get something similar. Seems like a client bug, but I'm not certain.

    public static void main(String[] args) {
        MemcachedClient mc = new MemcachedClient();
                String key   = "counterKey";
                mc.storeCounter(key, 10L);
                System.out.println(mc.incr(key, 1L));
                System.out.println(mc.incr(key, 1L));
                System.out.println(mc.get(key));
                System.out.println(mc.getCounter(key));

-1
-1
null
-1

With correct code using the spymemcached client, I get expected results.

        spymc.set("spy" + key, 0, "10");
        System.err.println(spymc.get("spy" + key));
        System.err.println(spymc.incr("spy" + key, 1L));
        System.err.println(spymc.incr("spy" + key, 1L));
        System.err.println(spymc.get("spy" + key));


10
11
12
12

In any event, it appears to not be a server bug.

Reply via email to