From: xie xingguo Date: Wed, 20 Nov 2019 00:31:54 +0000 (+0800) Subject: osd/PeeringState: do not exclude up from acting_recovery_backfill X-Git-Tag: v13.2.9~56^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4df29d4633f8a4817b4cb05aa60923cf54aee5a3;p=ceph.git osd/PeeringState: do not exclude up from acting_recovery_backfill If we choose a primary that does not belong to the current up set, and all up peers are still recoverable, then we might end up excluding some up peer from the acting_recovery_backfill set too due to the "want size <= pool size" constraint (since https://github.com/ceph/ceph/pull/24035), as a result of which all up peers might not get recovered in one go. Fix by falling through any oversized want set to async recovery, which should be able to handle it nicely. Fixes: https://tracker.ceph.com/issues/42577 Signed-off-by: xie xingguo (cherry picked from commit 22c8cdad8ee1d7376c7d200bdb6ec94ed6d3b5e6) Conflicts: src/osd/PeeringState.cc - file does not exist in mimic; made the change manually to src/osd/PG.cc --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 0e818d1651e7..c4da5cf50224 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1709,6 +1709,14 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id, choose_async_recovery_replicated(all_info, auth_log_shard->second, &want, &want_async_recovery); } } + while (want.size() > pool.info.size) { + // async recovery should have taken out as many osds as it can. + // if not, then always evict the last peer + // (will get synchronously recovered later) + dout(10) << __func__ << " evicting osd." << want.back() + << " from oversized want " << want << dendl; + want.pop_back(); + } if (want != acting) { dout(10) << __func__ << " want " << want << " != acting " << acting << ", requesting pg_temp change" << dendl;