From: Greg Farnum Date: Thu, 11 Mar 2021 07:19:26 +0000 (+0000) Subject: osd: PeeringState: add a comment about using size as a proxy for activateable X-Git-Tag: v17.1.0~2614^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e19639af364d5a9762898e4aa438ad5930f0d42c;p=ceph.git osd: PeeringState: add a comment about using size as a proxy for activateable 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 --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 7f6eb9b2c60..4d6892473aa 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -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());