From: Sage Weil Date: Tue, 19 Sep 2017 19:44:50 +0000 (-0500) Subject: osd/PG: set {backfill,recovery}_wait when canceling backfill/recovery X-Git-Tag: v12.2.2~157^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6c529092e8f4bd1e2a4a4069bf9f319d49430ccb;p=ceph.git osd/PG: set {backfill,recovery}_wait when canceling backfill/recovery 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 (cherry picked from commit 4b216771bd31e5712471e13ad32ee8a1e519eb30) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index da4da001e04..c5899b7716f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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::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();