]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: restart recovery if NotRecovering and unfound found
authorSage Weil <sage@redhat.com>
Thu, 16 Nov 2017 20:26:27 +0000 (14:26 -0600)
committerDavid Zafman <dzafman@redhat.com>
Mon, 22 Jan 2018 18:40:58 +0000 (10:40 -0800)
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 <sage@redhat.com>
(cherry picked from commit 4cfe31c63b519f2dce22f061c9951c302f6efb1e)

Conflicts:
src/osd/PG.h (trivial, not all events exist in luminous)

src/osd/PG.cc
src/osd/PG.h

index 541747bbd47112dd6fed8225b16a9bbaf919cdc3..081229eeadc8b07ea98e98698742b7c1dacc6ec1 100644 (file)
@@ -7363,9 +7363,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();
 }
 
index 70139192175ab1c81129701a323aa4ec6f53dd3d..4ea2d0b9ef3f67251b0f8e6d8678f7b56ca152d9 100644 (file)
@@ -1885,7 +1885,8 @@ public:
        boost::statechart::custom_reaction< Backfilled >,
        boost::statechart::custom_reaction< AllReplicasActivated >,
        boost::statechart::custom_reaction< DeferRecovery >,
-       boost::statechart::custom_reaction< DeferBackfill >
+       boost::statechart::custom_reaction< DeferBackfill >,
+       boost::statechart::custom_reaction< DoRecovery>
        > reactions;
       boost::statechart::result react(const QueryState& q);
       boost::statechart::result react(const ActMap&);
@@ -1903,6 +1904,9 @@ public:
       boost::statechart::result react(const DeferBackfill& evt) {
        return discard_event();
       }
+      boost::statechart::result react(const DoRecovery&) {
+       return discard_event();
+      }
     };
 
     struct Clean : boost::statechart::state< Clean, Active >, NamedState {