From 8d52fb70e19f6f14542d2d66b8ca05017004345f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 7 Mar 2014 14:02:26 -0800 Subject: [PATCH] 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 --- src/mon/PGMap.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); } } } -- 2.47.3