Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 245 by [email protected]: Binary Delete Stats are not recorded
http://code.google.com/p/memcached/issues/detail?id=245

***What steps will reproduce the problem?***
1. Start a memcached server
2. Send a binary packet for deleting "key" via
echo -en '\x80\x04\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6b\x65\x79' | nc localhost 11211

3. start a telnet to the server and send "stats" i.e.
telnet localhost 11211
stats

***What is the expected output? What do you see instead?***
-=Expected output =-
[...]
STAT delete_misses 1
STAT delete_hits 0
[...]
END

-=Observed Output=-
[...]
STAT delete_misses 0
STAT delete_hits 0
[...]
END


***What version of the product are you using? On what operating system?***
Memcached 1.4.7 on Ubuntu 11.10 x86

***Please provide any additional information below.***

The delete stats are recorded when I do an ascii request for a delete, but not when I do a binary request. Looking at the source, the code that increments the delete counter is indeed missing from the code to do a binary delete. More specifically in

   static void process_bin_delete(conn *c) of [memcached.c]

after the line "write_bin_response(c, NULL, 0, 0, 0);", there should be this block of code:

        pthread_mutex_lock(&c->thread->stats.mutex);
        c->thread->stats.delete_misses++;
        pthread_mutex_unlock(&c->thread->stats.mutex);


--Thanks,
Stephen Yang

Reply via email to