Skip to contentSkip to conversation

mon: fix pg state logging

PATCH Applied Yan, Zheng 2 participants 2 messages Jun 11, 2012

lore
Share & tools
lore

Yan, Zheng

author
#0 lore raw

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.

---
 src/mon/PGMonitor.cc |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
src/mon/PGMonitor.cc +6 -6
index 97fbb1b..1b0a210 100644
@@ -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
Applied
#1 lore raw
Quoted 4 lines · Zheng

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.

Thanks, applied!
sage

Quoted 39 lines
---
 src/mon/PGMonitor.cc |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
src/mon/PGMonitor.cc +6 -6
index 97fbb1b..1b0a210 100644
@@ -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