]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
PG: handle flushed event directly
authorwumingqiao <wumingqiao@inspur.com>
Wed, 8 Nov 2017 11:21:37 +0000 (19:21 +0800)
committerwumingqiao <wumingqiao@inspur.com>
Tue, 12 Dec 2017 01:00:11 +0000 (09:00 +0800)
Signed-off-by: wumingqiao <wumingqiao@inspur.com>
src/osd/PG.cc
src/osd/PG.h

index 402a9d7c65b9091931e9796e077a28f7f8bbf598..7f88a45c29774e9990067347db29fa23faf5f737 100644 (file)
@@ -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<PGPeeringEvent>(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&)
 {
index 3b806d3098617cf4ee864a073d8322acfc80807e..2a570f8857b783c8fd55cbec0f7c361f50b75db7 100644 (file)
@@ -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;