]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: send pg create messages to primary, not acting[0] 1404/head
authorSage Weil <sage@inktank.com>
Fri, 7 Mar 2014 22:02:26 +0000 (14:02 -0800)
committerSage Weil <sage@inktank.com>
Fri, 7 Mar 2014 22:02:26 +0000 (14:02 -0800)
For erasure pools, these may not match.

In the case of #7652, this caused pg_create messages to be send
indefinitely.  register_pg() added it to the list for acting_primary, and
when we got the (non-creating) pg stat update we removed it from the list
for acting[0].

Fixes: #7652
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/PGMap.cc

index 2d3d105cd48d6ced6e4a9e0dee63350f03fdce3a..fbed206613d51c51922ea021d399b9908bd818c8 100644 (file)
@@ -391,8 +391,8 @@ void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s)
   pg_sum.add(s);
   if (s.state & PG_STATE_CREATING) {
     creating_pgs.insert(pgid);
-    if (s.acting.size())
-      creating_pgs_by_osd[s.acting[0]].insert(pgid);
+    if (s.acting_primary >= 0)
+      creating_pgs_by_osd[s.acting_primary].insert(pgid);
   }
 }
 
@@ -410,10 +410,10 @@ void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s)
   pg_sum.sub(s);
   if (s.state & PG_STATE_CREATING) {
     creating_pgs.erase(pgid);
-    if (s.acting.size()) {
-      creating_pgs_by_osd[s.acting[0]].erase(pgid);
-      if (creating_pgs_by_osd[s.acting[0]].size() == 0)
-        creating_pgs_by_osd.erase(s.acting[0]);
+    if (s.acting_primary >= 0) {
+      creating_pgs_by_osd[s.acting_primary].erase(pgid);
+      if (creating_pgs_by_osd[s.acting_primary].size() == 0)
+        creating_pgs_by_osd.erase(s.acting_primary);
     }
   }
 }