Skip to content

Commit

Permalink
osd: PeeringState: add a comment about using size as a proxy for acti…
Browse files Browse the repository at this point in the history
…vateable

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 <[email protected]>
  • Loading branch information
gregsfortytwo committed Mar 12, 2021
1 parent e9185b0 commit e19639a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/osd/PeeringState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit e19639a

Please sign in to comment.