Merge pull request #201 from digitalocean/luminous-snaptrim-fix

Luminous snaptrim fix
This commit is contained in:
Matt1360 2021-09-09 14:45:36 -03:00 committed by GitHub
commit 8ff393a633
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -1296,6 +1296,10 @@ func (c *ClusterHealthCollector) collect(ch chan<- prometheus.Metric) error {
if state == "scrubbing" {
val -= *pgStateCounterMap["scrubbing+deep"]
}
if state == "snaptrim" {
val -= *pgStateCounterMap["snaptrim_wait"]
}
gauge.Set(val)
if state == "scrubbing+deep" {
state = "deep_scrubbing"

View File

@ -333,6 +333,14 @@ $ sudo ceph -s
{
"state_name": "active+clean+inconsistent",
"count": 1
},
{
"state_name": "active+clean+snaptrim",
"count": 15
},
{
"state_name": "active+clean+snaptrim_wait",
"count": 25
}
],
"num_pgs": 52000
@ -340,10 +348,12 @@ $ sudo ceph -s
"health": {"summary": [{"severity": "HEALTH_WARN", "summary": "7 pgs undersized"}]}
}`,
regexes: []*regexp.Regexp{
regexp.MustCompile(`active_pgs{cluster="ceph"} 8`),
regexp.MustCompile(`active_pgs{cluster="ceph"} 48`),
regexp.MustCompile(`scrubbing_pgs{cluster="ceph"} 2`),
regexp.MustCompile(`deep_scrubbing_pgs{cluster="ceph"} 5`),
regexp.MustCompile(`inconsistent_pgs{cluster="ceph"} 1`),
regexp.MustCompile(`snaptrim_pgs{cluster="ceph"} 15`),
regexp.MustCompile(`snaptrim_wait_pgs{cluster="ceph"} 25`),
},
},
{