Twemcache metrics inconsistency during slab eviction
michalbiesek opened this issue · 2 comments
General Information
During slab eviction operation, all items in slab which is currently evicted are removed from hashtable, but unfortunately stats related to this operation are not updated, which could result in misleading information about current state of db.
Reproduction steps
I think the simplest steps would be to follow scenario presented in:
pelikan/test/storage/slab/check_slab.c
Line 586 in 4e4fa90
and print the stats just after inserting all the items (where eviction happened), e.g.:
- item_linked_curr 3
- item_curr 3
- item_unlink 0
This is not consistent with state of hashtable in the end of test ( only one item is present there)
Additional Information
pelikan/src/storage/slab/slab.c
Lines 602 to 604 in 4e4fa90
I think what is missing here is updating the statistics (SLAB_METRIC) related to this operation, e.g. item_linked_curr, item_unlink ...
Good find! If you don't get to it I will fix it in the next week or two.
@thinkingfish
I would like to leave the fix to you, since I will not be able to perform this fix in next two weeks.