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:
Yan, Zheng 2012-06-11 10:33:00 +08:00 committed by Sage Weil
parent 5cd33cdd23
commit ee7a027b9d

View File

@ -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);