]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: do not wait for flushed before activation 1440/head
authorSamuel Just <sam.just@inktank.com>
Tue, 11 Mar 2014 21:23:10 +0000 (14:23 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 12 Mar 2014 17:38:21 +0000 (10:38 -0700)
This should reduce the sting of the previous commit somewhat.  We wait
for the activation transactions to clear prior to accepting IO anyway,
so we can go ahead and get that process started without waiting for the
flush.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index b704556aab66fc03d08ea269631c6e9219ece633..33f7914182e4de3e4ff81ee795b0d545d1c76b26 100644 (file)
@@ -7070,7 +7070,7 @@ PG::RecoveryState::GetMissing::GetMissing(my_context ctx)
     }
 
     // all good!
-    post_event(CheckRepops());
+    post_event(Activate(pg->get_osdmap()->get_epoch()));
   }
 }
 
@@ -7089,7 +7089,7 @@ boost::statechart::result PG::RecoveryState::GetMissing::react(const MLogRec& lo
     } else {
       dout(10) << "Got last missing, don't need missing "
               << "posting CheckRepops" << dendl;
-      post_event(CheckRepops());
+      post_event(Activate(pg->get_osdmap()->get_epoch()));
     }
   }
   return discard_event();
@@ -7129,35 +7129,6 @@ void PG::RecoveryState::GetMissing::exit()
   pg->osd->recoverystate_perf->tinc(rs_getmissing_latency, dur);
 }
 
-/*---WaitFlushedPeering---*/
-PG::RecoveryState::WaitFlushedPeering::WaitFlushedPeering(my_context ctx)
-  : my_base(ctx),
-    NamedState(context< RecoveryMachine >().pg->cct, "Started/Primary/Peering/WaitFlushedPeering")
-{
-  PG *pg = context< RecoveryMachine >().pg;
-  context< RecoveryMachine >().log_enter(state_name);
-  if (context< RecoveryMachine >().pg->flushes_in_progress == 0)
-    post_event(Activate(pg->get_osdmap()->get_epoch()));
-}
-
-boost::statechart::result
-PG::RecoveryState::WaitFlushedPeering::react(const FlushedEvt &evt)
-{
-  PG *pg = context< RecoveryMachine >().pg;
-  pg->on_flushed();
-  return transit< WaitFlushedPeering >();
-}
-
-boost::statechart::result
-PG::RecoveryState::WaitFlushedPeering::react(const QueryState &q)
-{
-  q.f->open_object_section("state");
-  q.f->dump_string("name", state_name);
-  q.f->dump_stream("enter_time") << enter_time;
-  q.f->dump_string("comment", "waiting for flush");
-  return forward_event();
-}
-
 /*------WaitUpThru--------*/
 PG::RecoveryState::WaitUpThru::WaitUpThru(my_context ctx)
   : my_base(ctx),
@@ -7170,7 +7141,7 @@ boost::statechart::result PG::RecoveryState::WaitUpThru::react(const ActMap& am)
 {
   PG *pg = context< RecoveryMachine >().pg;
   if (!pg->need_up_thru) {
-    post_event(CheckRepops());
+    post_event(Activate(pg->get_osdmap()->get_epoch()));
   }
   return forward_event();
 }
index 5eb2d23f72f9b20eb34ef046456830679ce5a3dc..4c1b2cf295eb1109c402159eadd4b95307360aad 100644 (file)
@@ -1795,7 +1795,6 @@ public:
     };
 
     struct WaitUpThru;
-    struct WaitFlushedPeering;
 
     struct GetMissing : boost::statechart::state< GetMissing, Peering >, NamedState {
       set<pg_shard_t> peer_missing_requested;
@@ -1806,25 +1805,12 @@ public:
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< QueryState >,
        boost::statechart::custom_reaction< MLogRec >,
-       boost::statechart::transition< NeedUpThru, WaitUpThru >,
-       boost::statechart::transition< CheckRepops, WaitFlushedPeering>
+       boost::statechart::transition< NeedUpThru, WaitUpThru >
        > reactions;
       boost::statechart::result react(const QueryState& q);
       boost::statechart::result react(const MLogRec& logevt);
     };
 
-    struct WaitFlushedPeering :
-      boost::statechart::state< WaitFlushedPeering, Peering>, NamedState {
-      WaitFlushedPeering(my_context ctx);
-      void exit() {}
-      typedef boost::mpl::list <
-       boost::statechart::custom_reaction< QueryState >,
-       boost::statechart::custom_reaction< FlushedEvt >
-      > reactions;
-      boost::statechart::result react(const FlushedEvt& evt);
-      boost::statechart::result react(const QueryState& q);
-    };
-
     struct WaitUpThru : boost::statechart::state< WaitUpThru, Peering >, NamedState {
       WaitUpThru(my_context ctx);
       void exit();
@@ -1832,7 +1818,6 @@ public:
       typedef boost::mpl::list <
        boost::statechart::custom_reaction< QueryState >,
        boost::statechart::custom_reaction< ActMap >,
-       boost::statechart::transition< CheckRepops, WaitFlushedPeering>,
        boost::statechart::custom_reaction< MLogRec >
        > reactions;
       boost::statechart::result react(const QueryState& q);