From a16ce583273e42924f2cce61d4ce8832b76e01a4 Mon Sep 17 00:00:00 2001 From: dormando Date: Wed, 11 Jan 2012 16:52:47 -0800 Subject: binary deletes were not ticking stats counters Thanks to Stephen Yang for the bug report. --- memcached.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/memcached.c b/memcached.c index a86248f..33d3e80 100644 --- a/memcached.c +++ b/memcached.c @@ -2159,6 +2159,9 @@ static void process_bin_delete(conn *c) { uint64_t cas = ntohll(req->message.header.request.cas); if (cas == 0 || cas == ITEM_get_cas(it)) { MEMCACHED_COMMAND_DELETE(c->sfd, ITEM_key(it), it->nkey); + pthread_mutex_lock(&c->thread->stats.mutex); + c->thread->stats.slab_stats[it->slabs_clsid].delete_hits++; + pthread_mutex_unlock(&c->thread->stats.mutex); item_unlink(it); write_bin_response(c, NULL, 0, 0, 0); } else { @@ -2167,6 +2170,9 @@ static void process_bin_delete(conn *c) { item_remove(it); /* release our reference */ } else { write_bin_error(c, PROTOCOL_BINARY_RESPONSE_KEY_ENOENT, 0); + pthread_mutex_lock(&c->thread->stats.mutex); + c->thread->stats.delete_misses++; + pthread_mutex_unlock(&c->thread->stats.mutex); } } -- cgit v1.2.1