Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pageserver): use the larger one of upper limit and threshold
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi Z <chi@neon.tech>
skyzh committed Jan 29, 2025
1 parent 5bcefb4 commit 92056c5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pageserver/src/tenant/timeline/compaction.rs
Original file line number Diff line number Diff line change
@@ -1115,7 +1115,13 @@ impl Timeline {
// Under normal circumstances, we will accumulate up to compaction_upper_limit L0s of size
// checkpoint_distance each. To avoid edge cases using extra system resources, bound our
// work in this function to only operate on this much delta data at once.
let delta_size_limit = self.get_compaction_upper_limit() as u64
//
// In general, compaction_threshold should be <= compaction_upper_limit, but in case that
// the constraint is not respected, we use the larger of the two.
let delta_size_limit = std::cmp::max(
self.get_compaction_upper_limit(),
self.get_compaction_threshold(),
) as u64
* std::cmp::max(self.get_checkpoint_distance(), DEFAULT_CHECKPOINT_DISTANCE);

let mut fully_compacted = true;

0 comments on commit 92056c5

Please sign in to comment.