From: xie xingguo Date: Thu, 12 Dec 2019 06:01:45 +0000 (+0800) Subject: osd/PeeringState: transit async_recovery_targets back into acting before backfilling X-Git-Tag: v15.1.0~373^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48bc4786fd73b538b673e6a7eb7ced986d95005f;p=ceph.git osd/PeeringState: transit async_recovery_targets back into acting before backfilling When an osd that is part of current up set gets chosen as an async_recovery_target, it gets removed from the acting set. Since we don't allow any want that is larger than the pool size, a pg must transit into UNDERSIZED when asynchronous recovery eventually happens. However, if that pg has one or more backfill targets, it might spin UNDERSIZED for a long time during which mon will keep issuing "PG_AVAILABILITY" warns until all backfill targets finally completes. Fix by calling choose_acting to get any async_recovery_targets back into acting before we continue to backfill. Fixes: https://tracker.ceph.com/issues/43311 Signed-off-by: xie xingguo --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 99534bcc620..10a8d72561b 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -5347,7 +5347,14 @@ PeeringState::Recovering::react(const RequestBackfill &evt) ps->state_clear(PG_STATE_FORCED_RECOVERY); pl->cancel_local_background_io_reservation(); pl->publish_stats_to_osd(); - // XXX: Is this needed? + // transit any async_recovery_targets back into acting + // so pg won't have to stay undersized for long + // as backfill might take a long time to complete.. + if (!ps->async_recovery_targets.empty()) { + pg_shard_t auth_log_shard; + bool history_les_bound = false; + ps->choose_acting(auth_log_shard, true, &history_les_bound); + } return transit(); }