mon: fix pg state logging
PATCH 1/1 mon: fix pg state logging
From: "Yan, Zheng" <[email protected]>
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 <[email protected]>
--- src/mon/PGMonitor.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
src/mon/PGMonitor.cc +6 -6
@@ -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);
Signature · 1 line
1.7.10.2
Sage Weil
AppliedQuoted 4 lines · Zheng
From: "Yan, Zheng" <[email protected]>
PGMap->num_pg_by_stateis a PG state to number of PG in the state mapping.PGMonitor::update_loggerwrongly interprets the mapping.
Thanks, applied!
sage
Quoted 39 lines
Signed-off-by Yan, Zheng <[email protected]>--- src/mon/PGMonitor.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)src/mon/PGMonitor.cc +6
-6@@ -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);Signature · 6 lines
1.7.10.2 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html