Skip to content

simplify compaction algorithm#1932

Merged
Theodus merged 3 commits intomainfrom
theodus/compaction-wip
Mar 6, 2026
Merged

simplify compaction algorithm#1932
Theodus merged 3 commits intomainfrom
theodus/compaction-wip

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Mar 6, 2026

This a proposal to simplify the compaction algorithm into essentially:

  • Iterate over the canonical chain in order.
    • If a file that is not under cooldown is found, start a compaction group.
      • Add files to that group until the target would be exceeded.

Generation-based compaction for files under cooldown is removed. Eager compaction configuration for recent files is simplified to be purely generation based, replacing the more complex eager_compaction_limit.

Replaces #1417, #1913

leoyvens and others added 3 commits March 6, 2026 12:13
The predicate for Live files was returning `*size_exceeded` which meant
files could only join a group when combined size ALREADY exceeded the
target. Since two small files can never exceed 512 MiB, no groups were
ever formed in "Strict Eager Compaction" mode (when eager_compaction_limit
>= target_partition_size).

Changed to `!*size_exceeded` to match Cold file behavior: files can join
a group as long as combined size does NOT exceed the target. This allows
accumulating many small files until they reach the target size.

Signed-off-by: Theo Butler <theodusbutler@gmail.com>
Signed-off-by: Theo Butler <theodusbutler@gmail.com>
Signed-off-by: Theo Butler <theodusbutler@gmail.com>
@Theodus Theodus force-pushed the theodus/compaction-wip branch from 7927b42 to b8b8a69 Compare March 6, 2026 19:13
@Theodus Theodus merged commit 9106e49 into main Mar 6, 2026
8 checks passed
@Theodus Theodus deleted the theodus/compaction-wip branch March 6, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants