From 6c529092e8f4bd1e2a4a4069bf9f319d49430ccb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 19 Sep 2017 14:44:50 -0500 Subject: [PATCH] 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) --- src/osd/PG.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index da4da001e0404..c5899b7716f57 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(); -- 2.39.5