Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

binary deletes were not ticking stats counters

Thanks to Stephen Yang for the bug report.
  • Loading branch information...
commit a16ce583273e42924f2cce61d4ce8832b76e01a4 1 parent 96c07ae
@dormando dormando authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 memcached.c
View
6 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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.