From: Sage Weil Date: Fri, 7 Mar 2014 22:02:26 +0000 (-0800) Subject: mon/PGMap: send pg create messages to primary, not acting[0] X-Git-Tag: v0.78~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1404%2Fhead;p=ceph.git mon/PGMap: send pg create messages to primary, not acting[0] 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 --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 2d3d105cd48d6..fbed206613d51 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -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); } } }