]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: PeeringState: add a comment about using size as a proxy for activateable
authorGreg Farnum <gfarnum@redhat.com>
Thu, 11 Mar 2021 07:19:26 +0000 (07:19 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 12 Mar 2021 20:56:45 +0000 (20:56 +0000)
When reviewing, I mistakenly thought we needed to skip a size check in
choose_acting() in case of mismatches between size and bucket counts, but that
is not accurate!

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/osd/PeeringState.cc

index 7f6eb9b2c60159de196977ac9cd027740469b715..4d6892473aae70c4f75f7d54de89ae9860ae3b77 100644 (file)
@@ -2107,7 +2107,13 @@ void PeeringState::calc_replicated_acting_stretch(
     aheap.push_if_nonempty(anc.second);
   });
 
-  /* and pull from this heap until it's empty or we have enough. */
+  /* and pull from this heap until it's empty or we have enough.
+   * "We have enough" is a sufficient check here for
+   * stretch_set_can_peer() because our heap sorting always
+   * pulls from ancestors with the least number of included OSDs,
+   * so if it is possible to satisfy the bucket_count constraints we
+   * will do so.
+   */
   while (!aheap.is_empty() && want->size() < pool.info.size) {
     auto next = aheap.pop();
     pop_ancestor(next.get());