Skip to content

fix(amp-worker-core): compaction skips latest segments#1969

Merged
Theodus merged 1 commit intomainfrom
theodus/compaction
Mar 16, 2026
Merged

fix(amp-worker-core): compaction skips latest segments#1969
Theodus merged 1 commit intomainfrom
theodus/compaction

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Mar 12, 2026

Add a skip_latest_segments config option (default: 3) that drops the last N segments from the canonical chain before compaction planning. This avoids compacting recently-written data that may contain reorganized blocks.

@Theodus Theodus changed the title fix(amp-worker-core): exclude hot files from compaction groups entirely fix(amp-worker-core): exclude hot files from compaction groups Mar 12, 2026
@leoyvens
Copy link
Collaborator

Current behaviour is intentional. In the principle that if we're compacting then we might as well try to pack the group as optimally as possible.

If very recent files gen 0 should be excluded due to the reorg problem, that should imo have a specific mechanism for preventing compaction of recent files.

@Theodus Theodus force-pushed the theodus/compaction branch from 2b7eae7 to 96586f2 Compare March 16, 2026 14:16
@Theodus
Copy link
Member Author

Theodus commented Mar 16, 2026

@leoyvens, updated to only prevent raw files from starting/joining the compaction group until cooldown.

@Theodus Theodus force-pushed the theodus/compaction branch from 96586f2 to c7cc040 Compare March 16, 2026 14:56
@Theodus Theodus changed the title fix(amp-worker-core): exclude hot files from compaction groups fix(amp-worker-core): add initial_compaction_delay exclude new raw files from compaction Mar 16, 2026
@Theodus Theodus changed the title fix(amp-worker-core): add initial_compaction_delay exclude new raw files from compaction fix(amp-worker-core): add initial_compaction_delay to exclude new raw files from compaction Mar 16, 2026
@Theodus Theodus force-pushed the theodus/compaction branch 2 times, most recently from c5a7f6a to 291cc4d Compare March 16, 2026 14:59
@Theodus Theodus changed the title fix(amp-worker-core): add initial_compaction_delay to exclude new raw files from compaction fix(amp-worker-core): delay compaction of newly written raw files Mar 16, 2026
@Theodus Theodus force-pushed the theodus/compaction branch from 291cc4d to 79e2a5a Compare March 16, 2026 17:11
Add a `skip_latest_segments` config option (default: 3) that drops the
last N segments from the canonical chain before compaction planning.
This avoids compacting recently-written data that may contain
reorganized blocks.
@Theodus Theodus force-pushed the theodus/compaction branch from 79e2a5a to 218bac7 Compare March 16, 2026 17:12
@Theodus Theodus changed the title fix(amp-worker-core): delay compaction of newly written raw files fix(amp-worker-core): compaction skips latest segments Mar 16, 2026
@Theodus Theodus requested a review from leoyvens March 16, 2026 17:13
@Theodus Theodus merged commit 7ecc4a9 into main Mar 16, 2026
8 checks passed
@Theodus Theodus deleted the theodus/compaction branch March 16, 2026 17:54
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.

2 participants