summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-12-13 17:53:31 -0800
committerdormando <dormando@rydia.net>2017-12-13 17:53:31 -0800
commita986316d2b2f9a5aef123703b20ac9dbdba78a9f (patch)
tree408f5bf2de6b7ccfb42fd7bff0c7904f3c22488a /items.c
parent95246f7947e9d95969d04db0898a93ef66235fb0 (diff)
downloadmemcached-a986316d2b2f9a5aef123703b20ac9dbdba78a9f.tar.gz
extstore: close hole with storage tracking
items expired/evicted while pulling from tail weren't being tracked, leading to a leak of object counts in pages.
Diffstat (limited to 'items.c')
-rw-r--r--items.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/items.c b/items.c
index 5153420..400048b 100644
--- a/items.c
+++ b/items.c
@@ -1106,6 +1106,7 @@ int lru_pull_tail(const int orig_id, const int cur_lru,
itemstats[id].tailrepairs++;
search->refcount = 1;
/* This will call item_remove -> item_free since refcnt is 1 */
+ STORAGE_delete(ext_storage, search);
do_item_unlink_nolock(search, hv);
item_trylock_unlock(hold_lock);
continue;
@@ -1121,6 +1122,7 @@ int lru_pull_tail(const int orig_id, const int cur_lru,
}
/* refcnt 2 -> 1 */
do_item_unlink_nolock(search, hv);
+ STORAGE_delete(ext_storage, search);
/* refcnt 1 -> 0 -> item_free */
do_item_remove(search);
item_trylock_unlock(hold_lock);
@@ -1186,6 +1188,7 @@ int lru_pull_tail(const int orig_id, const int cur_lru,
itemstats[id].evicted_active++;
}
LOGGER_LOG(NULL, LOG_EVICTIONS, LOGGER_EVICTION, search);
+ STORAGE_delete(ext_storage, search);
do_item_unlink_nolock(search, hv);
removed++;
if (settings.slab_automove == 2) {