From: wumingqiao Date: Wed, 8 Nov 2017 11:21:37 +0000 (+0800) Subject: PG: handle flushed event directly X-Git-Tag: wip-pdonnell-testing-20180317.202121~609^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9dfd251598f23bcbc490d7d51d76dae92132fafc;p=ceph-ci.git PG: handle flushed event directly Signed-off-by: wumingqiao --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 402a9d7c65b..7f88a45c297 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5316,7 +5316,7 @@ struct FlushState { ~FlushState() { pg->lock(); if (!pg->pg_has_reset_since(epoch)) - pg->queue_flushed(epoch); + pg->on_flushed(); pg->unlock(); } }; @@ -5873,14 +5873,6 @@ void PG::queue_null(epoch_t msg_epoch, NullEvt()))); } -void PG::queue_flushed(epoch_t e) -{ - dout(10) << "flushed" << dendl; - queue_peering_event( - PGPeeringEventRef(std::make_shared(e, e, - FlushedEvt()))); -} - void PG::queue_query(epoch_t msg_epoch, epoch_t query_epoch, pg_shard_t from, const pg_query_t& q) @@ -6113,16 +6105,6 @@ PG::RecoveryState::Started::react(const IntervalFlush&) return discard_event(); } - -boost::statechart::result -PG::RecoveryState::Started::react(const FlushedEvt&) -{ - PG *pg = context< RecoveryMachine >().pg; - pg->on_flushed(); - return discard_event(); -} - - boost::statechart::result PG::RecoveryState::Started::react(const AdvMap& advmap) { PG *pg = context< RecoveryMachine >().pg; @@ -6173,14 +6155,6 @@ PG::RecoveryState::Reset::Reset(my_context ctx) pg->set_last_peering_reset(); } -boost::statechart::result -PG::RecoveryState::Reset::react(const FlushedEvt&) -{ - PG *pg = context< RecoveryMachine >().pg; - pg->on_flushed(); - return discard_event(); -} - boost::statechart::result PG::RecoveryState::Reset::react(const IntervalFlush&) { diff --git a/src/osd/PG.h b/src/osd/PG.h index 3b806d30986..2a570f8857b 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1820,7 +1820,6 @@ protected: public: TrivialEvent(NullEvt) protected: - TrivialEvent(FlushedEvt) TrivialEvent(Backfilled) TrivialEvent(LocalBackfillReserved) public: @@ -2006,14 +2005,12 @@ protected: boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< ActMap >, boost::statechart::custom_reaction< NullEvt >, - boost::statechart::custom_reaction< FlushedEvt >, boost::statechart::custom_reaction< IntervalFlush >, boost::statechart::transition< boost::statechart::event_base, Crashed > > reactions; boost::statechart::result react(const QueryState& q); boost::statechart::result react(const AdvMap&); boost::statechart::result react(const ActMap&); - boost::statechart::result react(const FlushedEvt&); boost::statechart::result react(const IntervalFlush&); boost::statechart::result react(const boost::statechart::event_base&) { return discard_event(); @@ -2030,13 +2027,11 @@ protected: boost::statechart::custom_reaction< QueryState >, boost::statechart::custom_reaction< AdvMap >, boost::statechart::custom_reaction< NullEvt >, - boost::statechart::custom_reaction< FlushedEvt >, boost::statechart::custom_reaction< IntervalFlush >, boost::statechart::transition< boost::statechart::event_base, Crashed > > reactions; boost::statechart::result react(const QueryState& q); boost::statechart::result react(const AdvMap&); - boost::statechart::result react(const FlushedEvt&); boost::statechart::result react(const IntervalFlush&); boost::statechart::result react(const boost::statechart::event_base&) { return discard_event(); @@ -2839,6 +2834,7 @@ protected: // abstract bits + friend class FlushState; virtual void on_role_change() = 0; virtual void on_pool_change() = 0;