Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] slab_ids returns multiple items #8

Open
berislavlopac opened this issue Nov 5, 2019 · 0 comments
Open

[bug] slab_ids returns multiple items #8

berislavlopac opened this issue Nov 5, 2019 · 0 comments

Comments

@berislavlopac
Copy link

Currently, the slab_ids methods can return a list of several (four in my case) identical slab ID numbers. The reason is that _stat_regex is defined as STAT items:(.*):number, so it includes the stats that only start with number (for LRU cache). The memcached instance I'm using (on Xubuntu 19.10) returns four such stats, as can be seen in this telnet response (and according to the protocol even more are possible):

$ telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
stats items
STAT items:1:number 1
STAT items:1:number_hot 0
STAT items:1:number_warm 0
STAT items:1:number_cold 1
STAT items:1:age_hot 0
STAT items:1:age_warm 0
STAT items:1:age 13
STAT items:1:evicted 0
STAT items:1:evicted_nonzero 0
STAT items:1:evicted_time 0
STAT items:1:outofmemory 0
STAT items:1:tailrepairs 0
STAT items:1:reclaimed 0
STAT items:1:expired_unfetched 0
STAT items:1:evicted_unfetched 0
STAT items:1:evicted_active 0
STAT items:1:crawler_reclaimed 0
STAT items:1:crawler_items_checked 0
STAT items:1:lrutail_reflocked 0
STAT items:1:moves_to_cold 1
STAT items:1:moves_to_warm 0
STAT items:1:moves_within_lru 0
STAT items:1:direct_reclaims 0
STAT items:1:hits_to_hot 0
STAT items:1:hits_to_warm 0
STAT items:1:hits_to_cold 0
STAT items:1:hits_to_temp 0
END

There are two ways around that:

  1. Fix the regex to include the space at the end.
  2. Make slab_ids return a set of IDs, instead of a list.

I'd in fact like to propose implementing both, as I think set is a better representation of what slab_ids should return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant