mirror of
https://github.com/ceph/ceph
synced 2025-03-06 08:20:12 +00:00
mon: fix pg state logging
PGMap->num_pg_by_state is a PG state to number of PG in the state mapping. PGMonitor::update_logger wrongly interprets the mapping. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
5cd33cdd23
commit
ee7a027b9d
@ -96,13 +96,13 @@ void PGMonitor::update_logger()
|
||||
for (hash_map<int,int>::iterator p = pg_map.num_pg_by_state.begin();
|
||||
p != pg_map.num_pg_by_state.end();
|
||||
++p) {
|
||||
if (p->second & PG_STATE_ACTIVE) {
|
||||
active++;
|
||||
if (p->second & PG_STATE_CLEAN)
|
||||
active_clean++;
|
||||
if (p->first & PG_STATE_ACTIVE) {
|
||||
active += p->second;
|
||||
if (p->first & PG_STATE_CLEAN)
|
||||
active_clean += p->second;
|
||||
}
|
||||
if (p->second & PG_STATE_PEERING)
|
||||
peering++;
|
||||
if (p->first & PG_STATE_PEERING)
|
||||
peering += p->second;
|
||||
}
|
||||
mon->cluster_logger->set(l_cluster_num_pg_active_clean, active_clean);
|
||||
mon->cluster_logger->set(l_cluster_num_pg_active, active);
|
||||
|
Loading…
Reference in New Issue
Block a user