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
mgr/prometheus: fix PG state names #21288
Conversation
@jan--f this doesn't add all of the possible PG state strings from osd_types.cc -- I can't remember if it was intentional to have this be a subset of all the more obscure states, or not? |
@jcsp, proper pg_states. From PG_STATES = ['creating', 'active', 'clean', 'down', 'recovery_unfound',
'backfill_unfound', 'scrubbing', 'degraded', 'inconsistent',
'peering', 'repair', 'recovering', 'backfill_wait', 'incomplete',
'stale', 'remapped', 'deep', 'backfilling',
'backfill_toofull', 'recovery_wait', 'undersized', 'activating',
'peered', 'snaptrim', 'snaptrim_wait', 'recovery_toofull',
'snaptrim_error', 'forced_recovery', 'forced_backfill'] |
Hmm, I had assume the |
yep. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I had this on my list as well but then got distracted. I don't see a reason not to expose all possible pg states, but I also don't have strong feelings about it.
Regarding the broken states with dashes: I got the original list of pg states from the docs, so if this is a legitimate bug, the docs need a fix as well. Happy to push a PR if its valid to just list the states from |
OK -- I've just gone ahead and updated this PR to match osd_types.cc Probably ambiguous if the docs are to be considered buggy, as those are "sort of" human readable names, but it probably is simpler to update the docs with underscores to exactly match the output of |
@jcsp, please, don't ignore my |
Previously the state-to-string path called deep scrubbing "deep", but the string-to-state path called it "deep_scrub". Confusing! Also meant that the "pg ls" help output was wrong because it uses the state-to-string path. Signed-off-by: John Spray <john.spray@redhat.com>
...and reformat into a flat list in the same order as found in osd_types.cc so that it's easy to cross check. Fixes: https://tracker.ceph.com/issues/23584 Signed-off-by: John Spray <john.spray@redhat.com>
@k0ste good catch. I wasn't so much ignoring your list, as I was using osd_types.cc to make sure we got everything. However, it looks like there's actually an inconsistency (just for deep vs. deep_scrub) between pg_string_state and pg_state_string (I was copying from pg_string_state). I've updated this now to make everything use |
@jcsp, nice. |
...and add a couple of common missing ones.
Fixes: https://tracker.ceph.com/issues/23584
Signed-off-by: John Spray john.spray@redhat.com