From: Sage Weil Date: Tue, 19 Sep 2017 20:47:23 +0000 (-0500) Subject: osd/PG: Cancel{Recovery,Backfill} -> Defer{Recovery,Backfill} X-Git-Tag: v12.2.2~157^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=429804b6bd193611f7474174e45ce94d784fd184;p=ceph.git osd/PG: Cancel{Recovery,Backfill} -> Defer{Recovery,Backfill} "Defer" is more accurate here; we aren't canceling anything, just rescheduling the work. Signed-off-by: Sage Weil (cherry picked from commit 2e45497a20a0b61975fbf0cf851d417f31b35489) --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8bb38c2f83f6..db1a93266f0d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9404,14 +9404,14 @@ void OSD::do_recovery( auto evt = PG::CephPeeringEvtRef(new PG::CephPeeringEvt( queued, queued, - PG::CancelBackfill(cct->_conf->osd_recovery_retry_interval))); + PG::DeferBackfill(cct->_conf->osd_recovery_retry_interval))); pg->queue_peering_event(evt); action = "in backfill"; } else if (pg->state_test(PG_STATE_RECOVERING)) { auto evt = PG::CephPeeringEvtRef(new PG::CephPeeringEvt( queued, queued, - PG::CancelRecovery(cct->_conf->osd_recovery_retry_interval))); + PG::DeferRecovery(cct->_conf->osd_recovery_retry_interval))); pg->queue_peering_event(evt); action = "in recovery"; } else { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 80554a6c43dd..3c9b7417d642 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6400,9 +6400,10 @@ PG::RecoveryState::Backfilling::Backfilling(my_context ctx) } boost::statechart::result -PG::RecoveryState::Backfilling::react(const CancelBackfill &c) +PG::RecoveryState::Backfilling::react(const DeferBackfill &c) { PG *pg = context< RecoveryMachine >().pg; + ldout(pg->cct, 10) << "defer backfill, retry delay " << c.delay << dendl; pg->osd->local_reserver.cancel_reservation(pg->info.pgid); pg->state_set(PG_STATE_BACKFILL_WAIT); @@ -6947,9 +6948,10 @@ PG::RecoveryState::Recovering::react(const RequestBackfill &evt) } boost::statechart::result -PG::RecoveryState::Recovering::react(const CancelRecovery &evt) +PG::RecoveryState::Recovering::react(const DeferRecovery &evt) { PG *pg = context< RecoveryMachine >().pg; + ldout(pg->cct, 10) << "defer recovery, retry delay " << evt.delay << dendl; pg->state_clear(PG_STATE_RECOVERING); pg->state_set(PG_STATE_RECOVERY_WAIT); pg->osd->local_reserver.cancel_reservation(pg->info.pgid); diff --git a/src/osd/PG.h b/src/osd/PG.h index d73b48daf053..a67eaf1b1ba0 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1563,18 +1563,18 @@ public: *out << #T; \ } \ }; - struct CancelBackfill : boost::statechart::event { + struct DeferBackfill : boost::statechart::event { float delay; - explicit CancelBackfill(float delay) : delay(delay) {} + explicit DeferBackfill(float delay) : delay(delay) {} void print(std::ostream *out) const { - *out << "CancelBackfill: delay " << delay; + *out << "DeferBackfill: delay " << delay; } }; - struct CancelRecovery : boost::statechart::event { + struct DeferRecovery : boost::statechart::event { float delay; - explicit CancelRecovery(float delay) : delay(delay) {} + explicit DeferRecovery(float delay) : delay(delay) {} void print(std::ostream *out) const { - *out << "CancelRecovery: delay " << delay; + *out << "DeferRecovery: delay " << delay; } }; @@ -1890,12 +1890,12 @@ public: struct Backfilling : boost::statechart::state< Backfilling, Active >, NamedState { typedef boost::mpl::list< boost::statechart::transition< Backfilled, Recovered >, - boost::statechart::custom_reaction< CancelBackfill >, + boost::statechart::custom_reaction< DeferBackfill >, boost::statechart::custom_reaction< RemoteReservationRejected > > reactions; explicit Backfilling(my_context ctx); boost::statechart::result react(const RemoteReservationRejected& evt); - boost::statechart::result react(const CancelBackfill& evt); + boost::statechart::result react(const DeferBackfill& evt); void exit(); }; @@ -1935,10 +1935,10 @@ public: struct NotRecovering : boost::statechart::state< NotRecovering, Active>, NamedState { typedef boost::mpl::list< boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >, - boost::statechart::custom_reaction< CancelRecovery > + boost::statechart::custom_reaction< DeferRecovery > > reactions; explicit NotRecovering(my_context ctx); - boost::statechart::result react(const CancelRecovery& evt) { + boost::statechart::result react(const DeferRecovery& evt) { /* no-op */ return discard_event(); } @@ -2011,14 +2011,14 @@ public: struct Recovering : boost::statechart::state< Recovering, Active >, NamedState { typedef boost::mpl::list < boost::statechart::custom_reaction< AllReplicasRecovered >, - boost::statechart::custom_reaction< CancelRecovery >, + boost::statechart::custom_reaction< DeferRecovery >, boost::statechart::custom_reaction< RequestBackfill > > reactions; explicit Recovering(my_context ctx); void exit(); void release_reservations(bool cancel = false); boost::statechart::result react(const AllReplicasRecovered &evt); - boost::statechart::result react(const CancelRecovery& evt); + boost::statechart::result react(const DeferRecovery& evt); boost::statechart::result react(const RequestBackfill &evt); };