From a4a91ccdc503abe1a5e91723e03126c189e5a4b5 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 11 Mar 2014 14:23:10 -0700 Subject: [PATCH] PG: do not wait for flushed before activation 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 --- src/osd/PG.cc | 35 +++-------------------------------- src/osd/PG.h | 17 +---------------- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b704556aab66f..33f7914182e4d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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(); } diff --git a/src/osd/PG.h b/src/osd/PG.h index 5eb2d23f72f9b..4c1b2cf295eb1 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1795,7 +1795,6 @@ public: }; struct WaitUpThru; - struct WaitFlushedPeering; struct GetMissing : boost::statechart::state< GetMissing, Peering >, NamedState { set 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); -- 2.47.3