]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add Incomplete peering state
authorSage Weil <sage.weil@dreamhost.com>
Fri, 2 Dec 2011 04:46:12 +0000 (20:46 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Wed, 14 Dec 2011 19:31:32 +0000 (11:31 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index 4b74d1b29d636fbc148a4184156bec59072e551b..bcc5db4262ff820a31fdbda7d79499d194251ddb 100644 (file)
@@ -4485,8 +4485,7 @@ PG::RecoveryState::GetLog::GetLog(my_context ctx) :
   // am i broken?
   if (pg->info.last_update < best.log_tail) {
     dout(10) << " not contiguous with osd." << newest_update_osd << ", down" << dendl;
-    /*post_event(...something...); */
-#warning fixme need an event here?
+    post_event(IsIncomplete());
     return;
   }
 
@@ -4567,6 +4566,16 @@ void PG::RecoveryState::WaitActingChange::exit() {
   context< RecoveryMachine >().log_exit(state_name, enter_time);
 }
 
+/*------Incomplete--------*/
+PG::RecoveryState::Incomplete::Incomplete(my_context ctx) : my_base(ctx)
+{
+  state_name = "Started/Primary/Peering/Incomplete";
+  context< RecoveryMachine >().log_enter(state_name);
+}
+void PG::RecoveryState::Incomplete::exit() {
+  context< RecoveryMachine >().log_exit(state_name, enter_time);
+}
+
 /*------GetMissing--------*/
 PG::RecoveryState::GetMissing::GetMissing(my_context ctx) : my_base(ctx)
 {
index 0ebf0a6d92d9d34784c78711920430c52db04dd6..9d916a151983f2cf0de1ac725b1206846984ccb1 100644 (file)
@@ -1158,6 +1158,10 @@ public:
     struct NeedNewMap : boost::statechart::event< NeedNewMap > {
       NeedNewMap() : boost::statechart::event< NeedNewMap >() {}
     };
+    struct Incomplete;
+    struct IsIncomplete : boost::statechart::event< IsIncomplete > {
+      IsIncomplete() : boost::statechart::event< IsIncomplete >() {}
+    };
 
     struct Primary : boost::statechart::state< Primary, Started, Peering >, NamedState {
       Primary(my_context ctx);
@@ -1167,7 +1171,8 @@ public:
        boost::statechart::custom_reaction< ActMap >,
        boost::statechart::custom_reaction< MNotifyRec >,
        boost::statechart::custom_reaction< AdvMap >,
-       boost::statechart::transition< NeedNewMap, WaitActingChange >
+       boost::statechart::transition< NeedNewMap, WaitActingChange >,
+       boost::statechart::transition< IsIncomplete, Incomplete >
        > reactions;
       boost::statechart::result react(const ActMap&);
       boost::statechart::result react(const AdvMap&);
@@ -1183,6 +1188,12 @@ public:
       boost::statechart::result react(const MLogRec&);
       void exit();
     };
+
+    struct Incomplete : boost::statechart::state< Incomplete, Primary>,
+                       NamedState {
+      Incomplete(my_context ctx);
+      void exit();
+    };
     
     struct GetInfo;
     struct Active;