From: Kamoltat Date: Thu, 9 May 2024 20:18:51 +0000 (+0000) Subject: PeeringState.cc: Only populate want_acting when num_osds < bucket_max X-Git-Tag: v20.0.0~1314^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e26545f86f93985569d3a7b2749e9ad77a40deea;p=ceph.git PeeringState.cc: Only populate want_acting when num_osds < bucket_max Currently, in `calc_replicated_acting_stretch` we would call `pop_ancester` before checking whether the next OSD we populate in the want_acting set would have the ancestor count that is >= bucket_max. Fixes: https://tracker.ceph.com/issues/65371 Signed-off-by: Kamoltat --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 5401ef7526950..944b77c2812ae 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2106,7 +2106,9 @@ void PeeringState::calc_replicated_acting_stretch( * and then by the ordering token of the next osd */ bucket_heap_t aheap; std::for_each(ancestors.begin(), ancestors.end(), [&](auto &anc) { - aheap.push_if_nonempty(anc.second); + if (anc.second.get_num_selected() < bucket_max) { + aheap.push_if_nonempty(anc.second); + } }); /* and pull from this heap until it's empty or we have enough.