]> git-server-git.apps.pok.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>
Mon, 15 Mar 2021 18:38:52 +0000 (18:38 +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>
(cherry picked from commit e19639af364d5a9762898e4aa438ad5930f0d42c)

src/osd/PeeringState.cc

index 85c352303e365c6e23bf49f72a6cc2082108d8df..270b3caa625a2f6d94a3bf4a5ceef77380da31d2 100644 (file)
@@ -2121,7 +2121,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());