summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2018-02-12 14:13:53 -0800
committerdormando <dormando@rydia.net>2018-02-12 14:27:34 -0800
commit37bfa412de11c4a69e7fca0a88fd2759958647b2 (patch)
tree5c8c14565009c56c46d83239e65e5764a44fa611 /items.c
parentabfa8cf888db4ad9edc6b41b72f8d024d53290ee (diff)
downloadmemcached-37bfa412de11c4a69e7fca0a88fd2759958647b2.tar.gz
limit crawls for metadumper
LRU crawler metadumper is used for getting snapshot-y looks at the LRU's. Since there's no default limit, it'll get any new items added or bumped since the roll started. with this change it limits the number of items dumped to the number that existed in that LRU when the roll was kicked off. You still end up with an approximation, but not a terrible one: - items bumped after the crawler passes them likely won't be revisited - items bumped before the crawler passes them will likely be visited toward the end, or mixed with new items. - deletes are somewhere in the middle.
Diffstat (limited to 'items.c')
-rw-r--r--items.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/items.c b/items.c
index 400048b..488b461 100644
--- a/items.c
+++ b/items.c
@@ -138,6 +138,11 @@ static unsigned int temp_lru_size(int slabs_clsid) {
return ret;
}
+/* must be locked before call */
+unsigned int do_get_lru_size(uint32_t id) {
+ return sizes[id];
+}
+
/* Enable this for reference-count debugging. */
#if 0
# define DEBUG_REFCNT(it,op) \