]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: PeeringState: don't add acting-set OSDs to candidate set in stretch mode
authorGreg Farnum <gfarnum@redhat.com>
Thu, 11 Mar 2021 22:19:10 +0000 (22:19 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 12 Mar 2021 20:58:52 +0000 (20:58 +0000)
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 <gfarnum@redhat.com>
src/osd/PeeringState.cc

index f1eaef1bfa235e5d1d88a3be358a170debb4e625..804779c1ba9d3c75ed5d3ded5545be7a8f294135 100644 (file)
@@ -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));