]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: check_recovery_sources must happen even if not active
authorSamuel Just <sam.just@inktank.com>
Thu, 7 Mar 2013 20:53:51 +0000 (12:53 -0800)
committerSamuel Just <sam.just@inktank.com>
Thu, 14 Mar 2013 01:14:43 +0000 (18:14 -0700)
missing_loc/missing_loc_sources also must be cleaned up
if a peer goes down during peering:

1) pg is in GetInfo, acting is [3,1]
2) we find object A on osd [0] in GetInfo
3) 0 goes down, no new peering interval since it is neither up nor
acting, but peer_missing[0] is removed.
4) pg goes active and try to pull A from 0 since missing_loc did not get
cleaned up.

Backport: bobtail
Fixes: #4371
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index 5230c73f70e0d074c9fd1d94d351ddce9892b773..bee5be2cc0bef09c5e6cba8e675cd100fa93f43b 100644 (file)
@@ -5556,6 +5556,14 @@ PG::RecoveryState::Primary::Primary(my_context ctx)
   context< RecoveryMachine >().log_enter(state_name);
 }
 
+boost::statechart::result PG::RecoveryState::Primary::react(const AdvMap &advmap)
+{
+  PG *pg = context< RecoveryMachine >().pg;
+  pg->remove_down_peer_info(advmap.osdmap);
+  pg->check_recovery_sources(advmap.osdmap);
+  return forward_event();
+}
+
 boost::statechart::result PG::RecoveryState::Primary::react(const MNotifyRec& notevt)
 {
   dout(7) << "handle_pg_notify from osd." << notevt.from << dendl;
@@ -6146,7 +6154,6 @@ boost::statechart::result PG::RecoveryState::Active::react(const AdvMap& advmap)
     pg->dirty_info = true;
     pg->dirty_big_info = true;
   }
-  pg->check_recovery_sources(pg->get_osdmap());
 
   for (vector<int>::iterator p = pg->want_acting.begin();
        p != pg->want_acting.end(); ++p) {
@@ -6826,8 +6833,6 @@ boost::statechart::result PG::RecoveryState::WaitActingChange::react(const AdvMa
   PG *pg = context< RecoveryMachine >().pg;
   OSDMapRef osdmap = advmap.osdmap;
 
-  pg->remove_down_peer_info(osdmap);
-
   dout(10) << "verifying no want_acting " << pg->want_acting << " targets didn't go down" << dendl;
   for (vector<int>::iterator p = pg->want_acting.begin(); p != pg->want_acting.end(); ++p) {
     if (!osdmap->is_up(*p)) {
index 422c5437a8b295bbf613ebc36dc9543f5c817605..2deb23233147392f392781e925e9f0e3d5863d75 100644 (file)
@@ -1363,8 +1363,10 @@ public:
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< ActMap >,
        boost::statechart::custom_reaction< MNotifyRec >,
-       boost::statechart::transition< NeedActingChange, WaitActingChange >
+       boost::statechart::transition< NeedActingChange, WaitActingChange >,
+       boost::statechart::custom_reaction< AdvMap>
        > reactions;
+      boost::statechart::result react(const AdvMap&);
       boost::statechart::result react(const ActMap&);
       boost::statechart::result react(const MNotifyRec&);
     };