Skip to content

Commit

Permalink
binary deletes were not ticking stats counters
Browse files Browse the repository at this point in the history
Thanks to Stephen Yang for the bug report.
  • Loading branch information
dormando committed Jan 12, 2012
1 parent 96c07ae commit a16ce58
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
}

Expand Down

0 comments on commit a16ce58

Please sign in to comment.