From 3313a8b651e049de38421e37fae390a90b212dc9 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 11 Mar 2021 22:19:10 +0000 Subject: [PATCH] osd: PeeringState: don't add acting-set OSDs to candidate set in stretch mode We were adding them once from the acting set, and then once from the all_infos set, and that hit an assert later on. (I think it was otherwise harmless, but I don't want to weaken the assert!) Signed-off-by: Greg Farnum --- src/osd/PeeringState.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index f1eaef1bfa2..804779c1ba9 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2053,7 +2053,9 @@ void PeeringState::calc_replicated_acting_stretch( } if (!restrict_to_up_acting) { for (auto &[cand, info] : all_info) { - if (!used(cand.osd) && usable_info(info)) { + if (!used(cand.osd) && usable_info(info) && + (std::find(acting.begin(), acting.end(), cand.osd) + == acting.end())) { ss << " other candidate " << cand << " " << info << std::endl; candidates.push_back( std::make_pair(get_osd_ord(false, info), cand.osd)); -- 2.39.5