From d96732d2448173f70f6514610d1c3780a7c8fab1 Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Wed, 30 May 2018 11:33:41 -0700 Subject: [PATCH] PG: do not choose stray osds as async_recovery_targets Without this change, we might accept stray osds as async_recovery_targets, and need to ensure that they get a chance to become part of the acting set after recovery is over. However, when choose_acting() is called in the Recovered state, we set restrict_to_up_acting=true, which does not allow them to get back to the acting set. Therefore, similar to backfill, do not allow stray osds to become async_recovery_targets. Signed-off-by: Neha Ojha --- src/osd/PG.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b88dc45bd4986..63c3d37324fb1 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1510,6 +1510,9 @@ void PG::choose_async_recovery_ec(const map &all_info, // now. We could use minimum_to_decode_with_cost() later if // necessary. pg_shard_t shard_i((*want)[i], shard_id_t(i)); + // do not include strays + if (stray_set.find(shard_i) != stray_set.end()) + continue; auto shard_info = all_info.find(shard_i)->second; // for ec pools we rollback all entries past the authoritative // last_update *before* activation. This is relatively inexpensive @@ -1549,6 +1552,9 @@ void PG::choose_async_recovery_replicated(const map &all_ set > candidates_by_cost; for (auto osd_num : *want) { pg_shard_t shard_i(osd_num, shard_id_t::NO_SHARD); + // do not include strays + if (stray_set.find(shard_i) != stray_set.end()) + continue; auto shard_info = all_info.find(shard_i)->second; // use the approximate magnitude of the difference in length of // logs as the cost of recovery -- 2.39.5