]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PeeringState.cc: Only populate want_acting when num_osds < bucket_max 57381/head
authorKamoltat <ksirivad@redhat.com>
Thu, 9 May 2024 20:18:51 +0000 (20:18 +0000)
committerKamoltat Sirivadhna <ksirivad@redhat.com>
Mon, 5 Aug 2024 12:13:15 +0000 (12:13 +0000)
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 <ksirivad@redhat.com>
src/osd/PeeringState.cc

index 5401ef752695070883443378515529cf8bbda8f6..944b77c2812aeae57750315fdbc06bed478e1eb3 100644 (file)
@@ -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.