[core] Make compact_manifest perform a full manifest sort - #9802
Conversation
| type = @DataTypeHint("STRING"), | ||
| isOptional = true), | ||
| @ArgumentHint( | ||
| name = "manifest_sort_order", |
There was a problem hiding this comment.
Why we need to add this? We should just respect options in the table.
There was a problem hiding this comment.
Why we need to add this? We should just respect options in the table.
Thanks for review. I have remove it and follow table option.
|
|
||
| @ExcludeFromDocumentation("Only used by compact_manifest maintenance procedure") | ||
| public static final ConfigOption<Boolean> MANIFEST_SORT_FORCE_REWRITE = | ||
| key("manifest-sort.force-rewrite") |
There was a problem hiding this comment.
Do not introduce this too. By default, do full sort.
There was a problem hiding this comment.
Thanks. I removed the force option; compact_manifest now performs a full sort by default using the table options.
| continue; | ||
| } | ||
|
|
||
| // Phase 1: budget not yet exhausted -- perform aggressive sort rewrite. |
There was a problem hiding this comment.
[P2] Do not charge unchanged singleton sections against the rewrite budget
Removing this shortcut also changes ordinary commits (fullSort=false). rewriteSection still returns a singleton unchanged when it does not require delete cleanup, but rewriteSections now charges its size and can set budgetExhausted=true. Subsequent overlapping sections without default-compaction files are then skipped, even though no manifest has actually been rewritten.
I reproduced this with six ADD-only manifests, each with fileSize = 8 MiB: the first contains partition 0, and the other five have overlapping partition ranges [1, 2]. With bucket=-1, manifest sorting enabled, and a 4 MiB rewrite budget, the picker selects all five runs, but the unchanged first singleton exhausts the budget and all six manifests are returned unchanged. Restoring the original singleton shortcut for !ctx.fullSort makes the regression test pass and allows the overlapping manifests to be merged.
Please preserve the existing singleton handling for ordinary compaction, or only deduct budget for files that are actually rewritten, while retaining forced singleton rewriting for explicit full sort.
There was a problem hiding this comment.
Thanks. I restored the singleton shortcut for ordinary compaction while keeping singleton rewrites for explicit full sort, and added a regression test.
Purpose
This is the follow-up requested in #9784 and builds on #9791 and #9792. Existing tables can retain an older manifest layout, while regular manifest compaction may skip stable runs.
compact_manifestshould explicitly rebuild those manifests using the table's current options.Changes
compact_manifestenter the full-sort path by default.manifest-sort.max-rewrite-size, and leave regular commit compaction unchanged.This rewrites manifest files only, not data files.
Verification
CompactManifestProcedureITCase: 7 passed.CompactManifestProcedureTest: 2 passed.