Skip to content

fix(compaction): add immediate_compaction option, default false#1913

Closed
Theodus wants to merge 2 commits intomainfrom
theodus/compaction
Closed

fix(compaction): add immediate_compaction option, default false#1913
Theodus wants to merge 2 commits intomainfrom
theodus/compaction

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Mar 5, 2026

When immediate_compaction is false (the new default), segments within the cooldown period cannot be compacted. This prevents compaction from locking in data from an orphaned blockchain fork before a reorg settles.

Previously, "hot" segments (within cooldown) could still compact with same-generation segments, which could mix finalized and non-finalized blocks and create fragmentation that adds dignificant delays to reorg resolution.

@Theodus Theodus requested review from JohnSwan1503 and leoyvens March 5, 2026 19:51
@Theodus Theodus force-pushed the theodus/compaction branch from 1767267 to 91a008e Compare March 5, 2026 19:53
Theodus added 2 commits March 5, 2026 16:04
When immediate_compaction is false (the new default), segments within
the cooldown period cannot be compacted. This prevents compaction from
locking in data from an orphaned blockchain fork before a reorg settles.

Previously, "hot" segments (within cooldown) could still compact with
same-generation segments, which could mix finalized and non-finalized
blocks and create fragmentation that adds dignificant delays to reorg
resolution.
@Theodus
Copy link
Member Author

Theodus commented Mar 6, 2026

Replaced by #1932

@Theodus Theodus closed this Mar 6, 2026
Theodus added a commit that referenced this pull request 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

---------

Signed-off-by: Theo Butler <theodusbutler@gmail.com>
Co-authored-by: Leonardo Yvens <leoyvens@gmail.com>
@Theodus Theodus deleted the theodus/compaction 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.

1 participant