]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: peering: make Incomplete a Peering substate
authorSage Weil <sage@inktank.com>
Fri, 27 Jul 2012 23:03:26 +0000 (16:03 -0700)
committerSage Weil <sage@inktank.com>
Sat, 28 Jul 2012 16:04:32 +0000 (09:04 -0700)
This allows us to still catch changes in the prior set that would affect
our conclusions (that we are incomplete) and, when they happen, restart
peering.

Consider:
 - calc prior set, osd A is down
 - query everyone else, no good info
 - set down, go to Incomplete (previously WaitActingChange) state.
 - osd A comes back up (we do nothing)
 - osd A sends notify message with good info (we ignore)

By making this a Peering substate, we catch the Peering AdvMap reaction,
which will notice a prior set down osd is now up and move to Reset.

Fixes: #2860
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/PG.h

index c975e30dc1419ee8fa0f8e12eacd2be457cb166e..721d6b7935d780fed3020a9d0332caabbd6cd948 100644 (file)
@@ -1166,8 +1166,7 @@ public:
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< ActMap >,
        boost::statechart::custom_reaction< MNotifyRec >,
-       boost::statechart::transition< NeedActingChange, WaitActingChange >,
-       boost::statechart::transition< IsIncomplete, Incomplete >
+       boost::statechart::transition< NeedActingChange, WaitActingChange >
        > reactions;
       boost::statechart::result react(const ActMap&);
       boost::statechart::result react(const MNotifyRec&);
@@ -1191,12 +1190,6 @@ public:
       void exit();
     };
 
-    struct Incomplete : boost::statechart::state< Incomplete, Primary>,
-                       NamedState {
-      Incomplete(my_context ctx);
-      void exit();
-    };
-    
     struct GetInfo;
     struct Active;
 
@@ -1309,7 +1302,8 @@ public:
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< QueryState >,
        boost::statechart::custom_reaction< MLogRec >,
-       boost::statechart::custom_reaction< GotLog >
+       boost::statechart::custom_reaction< GotLog >,
+       boost::statechart::transition< IsIncomplete, Incomplete >
        > reactions;
       boost::statechart::result react(const QueryState& q);
       boost::statechart::result react(const MLogRec& logevt);
@@ -1362,6 +1356,11 @@ public:
       boost::statechart::result react(const MLogRec& logrec);
     };
 
+    struct Incomplete : boost::statechart::state< Incomplete, Peering>, NamedState {
+      Incomplete(my_context ctx);
+      void exit();
+    };
+
 
     RecoveryMachine machine;
     PG *pg;