From: Sage Weil Date: Fri, 27 Jul 2012 23:03:26 +0000 (-0700) Subject: osd: peering: make Incomplete a Peering substate X-Git-Tag: v0.51~57^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bae837010b6b486011b06dd97664fb54c3f3ff44;p=ceph.git osd: peering: make Incomplete a Peering substate 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 --- diff --git a/src/osd/PG.h b/src/osd/PG.h index c975e30dc141..721d6b7935d7 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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;