]> git.apps.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>
Fri, 27 Jul 2012 23:03:26 +0000 (16:03 -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 e785ebf046e011ab703a5b1621300bd246dfbe5c..4b843aa14bd3b7b40bad9e59709a31820e58d023 100644 (file)
@@ -1018,8 +1018,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&);
@@ -1043,12 +1042,6 @@ public:
       void exit();
     };
 
-    struct Incomplete : boost::statechart::state< Incomplete, Primary>,
-                       NamedState {
-      Incomplete(my_context ctx);
-      void exit();
-    };
-    
     struct GetInfo;
     struct Active;
 
@@ -1160,7 +1153,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);
@@ -1198,6 +1192,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;