From: Sage Weil Date: Thu, 16 Nov 2017 20:26:27 +0000 (-0600) Subject: osd/PG: restart recovery if NotRecovering and unfound found X-Git-Tag: v13.0.1~60^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4cfe31c63b519f2dce22f061c9951c302f6efb1e;p=ceph.git osd/PG: restart recovery if NotRecovering and unfound found If we are in recovery_unfound state waiting for unfound objects, and we find them, we need to restart the recovery reservation process so that we can recover. Do this by queueing DoRecover() event instead of calling queue_recovery() (which won't do anything since we're not in recoverying|backfilling pg states). Make the parent Active state ignore DoRecovery so that if we are already in some phase of recovery/backfill the event gets ignored. It is already handled by the other important substates that care, like Clean (for repair's benefit). I'm not sure why states like Activating are paying attention tot his vevent... Fixes: http://tracker.ceph.com/issues/22145 Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 005333530f0..7107325645f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -7403,9 +7403,9 @@ boost::statechart::result PG::RecoveryState::Active::react(const MLogRec& logevt pg->peer_missing[logevt.from], logevt.from, context< RecoveryMachine >().get_recovery_ctx()); - if (pg->is_peered() && - got_missing) - pg->queue_recovery(); + if (got_missing) { + post_event(DoRecovery()); + } return discard_event(); } diff --git a/src/osd/PG.h b/src/osd/PG.h index ec3856dc017..1bc67603e33 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -2159,7 +2159,8 @@ protected: boost::statechart::custom_reaction< UnfoundRecovery >, boost::statechart::custom_reaction< UnfoundBackfill >, boost::statechart::custom_reaction< RemoteReservationRevokedTooFull>, - boost::statechart::custom_reaction< RemoteReservationRevoked> + boost::statechart::custom_reaction< RemoteReservationRevoked>, + boost::statechart::custom_reaction< DoRecovery> > reactions; boost::statechart::result react(const QueryState& q); boost::statechart::result react(const ActMap&); @@ -2189,6 +2190,9 @@ protected: boost::statechart::result react(const RemoteReservationRevoked&) { return discard_event(); } + boost::statechart::result react(const DoRecovery&) { + return discard_event(); + } }; struct Clean : boost::statechart::state< Clean, Active >, NamedState {