]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: restart recovery if NotRecovering and unfound found 18974/head
authorSage Weil <sage@redhat.com>
Thu, 16 Nov 2017 20:26:27 +0000 (14:26 -0600)
committerSage Weil <sage@redhat.com>
Wed, 29 Nov 2017 18:44:59 +0000 (12:44 -0600)
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>
src/osd/PG.cc
src/osd/PG.h

index 005333530f06c1a9cefdf492379c39a59442fec3..7107325645fa443ad2f473d4f5424701a166b4a1 100644 (file)
@@ -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();
 }
 
index ec3856dc017431246e817a4a3beb06e5ef69b456..1bc67603e33ed6fd9c287ea5303a24b8b490bf07 100644 (file)
@@ -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 {