]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: set {backfill,recovery}_wait when canceling backfill/recovery
authorSage Weil <sage@redhat.com>
Tue, 19 Sep 2017 19:44:50 +0000 (14:44 -0500)
committerSage Weil <sage@redhat.com>
Thu, 28 Sep 2017 19:14:36 +0000 (15:14 -0400)
The only caller currently is when we get as far as we can with backfill
or recovery but still have unfound objects.  In this case, go back into
the *_wait state instead of appearing as though we are still doing
something.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 4b216771bd31e5712471e13ad32ee8a1e519eb30)

src/osd/PG.cc

index da4da001e0404e2b8daca753cdafc320359e303b..c5899b7716f570503b2a8fee4ca48e13ed71bcf4 100644 (file)
@@ -6404,9 +6404,9 @@ PG::RecoveryState::Backfilling::react(const CancelBackfill &)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->osd->local_reserver.cancel_reservation(pg->info.pgid);
-  // XXX: Add a new pg state so user can see why backfill isn't proceeding
-  // Can't use PG_STATE_BACKFILL_WAIT since it means waiting for reservations
-  //pg->state_set(PG_STATE_BACKFILL_STALLED????);
+
+  pg->state_set(PG_STATE_BACKFILL_WAIT);
+  pg->state_clear(PG_STATE_BACKFILL);
 
   for (set<pg_shard_t>::iterator it = pg->backfill_targets.begin();
        it != pg->backfill_targets.end();
@@ -6951,6 +6951,7 @@ PG::RecoveryState::Recovering::react(const CancelRecovery &evt)
 {
   PG *pg = context< RecoveryMachine >().pg;
   pg->state_clear(PG_STATE_RECOVERING);
+  pg->state_set(PG_STATE_RECOVERY_WAIT);
   pg->osd->local_reserver.cancel_reservation(pg->info.pgid);
   release_reservations(true);
   pg->schedule_recovery_full_retry();