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: v16.2.0~85^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=68e344ee6c76f336b522e012f1365f9521b48f67;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 (cherry picked from commit 3313a8b651e049de38421e37fae390a90b212dc9) --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 9a7af7fa2249..06be9301d45a 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2067,7 +2067,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));