From: Greg Farnum Date: Thu, 11 Mar 2021 22:19:10 +0000 (+0000) Subject: osd: PeeringState: don't add acting-set OSDs to candidate set in stretch mode X-Git-Tag: v17.1.0~2614^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3313a8b651e049de38421e37fae390a90b212dc9;p=ceph.git 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 --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index f1eaef1bfa235..804779c1ba9d3 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));