feat(compaction): add a pluggable CompactionExecutor - #9606
LuciferYang wants to merge 5 commits into
Conversation
Add CompactionExecutor + CompactionCommitter traits and a generic run_compaction_pipeline<E,C> driver, and route existing vertical compaction (rewrite_files + commit_compaction) through them as RewriteExecutor/RewriteCommitter. Pure refactor: compact_files_with_planner and the distributed CompactionTask::execute keep the same behavior, so the existing optimize suite still covers this path. This is the seam horizontal compaction plugs into as a second implementation.
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The shared execution path preserves vertical compaction's snapshot, bounded task execution, and single rewrite commit, while giving the planned horizontal path separate task and result types. Focused local and distributed compaction tests passed on this revision.
There was a problem hiding this comment.
✅ Gate recommendation: approve.
This revision changes only a documentation link. The executor and committer still preserve vertical compaction's snapshot, bounded task execution, and single rewrite commit; the focused local and distributed tests from the previous revision remain applicable.
|
Context, kept out of the description above: this is the pluggable executor/committer refactor from the #9604 stack, the "make compaction pluggable first" step, split out to review on its own. Horizontal compaction plugs in as a second |
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The revised documentation matches the internal driver's scope. The executor and committer preserve the existing vertical compaction flow, and the previously passing local and distributed compaction tests remain applicable.
…ect-safe CompactionExecutor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The public executor hook follows the requested pluggable planner/executor direction in #9291. It retains the existing snapshot, bounded task execution, and rewrite commit while allowing callers to supply an executor. The custom-executor, local compaction, and distributed compaction tests passed on this revision.
|
Closing. #9604 dropped this trait after review (#9604 (comment)): |
What
compact_filesgets a pluggable executor next to the pluggable planner it already has.CompactionExecutoris an object-safe trait with one method,execute(&Dataset, TaskData, &CompactionOptions) -> Result<RewriteResult>. It runs one task of aCompactionPlan.DefaultCompactionExecutorruns a task the way compaction always has, throughrewrite_files.compact_files_with_executor(dataset, remap_options, planner, executor)plans with the planner, runs every task through the executor, and commits the results withcommit_compaction. A caller can use it to run tasks somewhere else (for example on a cluster) or to wrap the default executor.compact_files_with_plannerandCompactionTask::executenow go throughDefaultCompactionExecutor.Behavior
No change.
DefaultCompactionExecutor::executecalls the samerewrite_files.compact_files_with_executorkeeps the oldcompact_files_with_plannershape: run the tagged-FRI check, return early on an empty plan, clone a read snapshot,buffer_unorderedover the tasks atnum_threadsconcurrency,try_collect, thencommit_compaction.Tests
compact_files_runs_tasks_through_the_given_executorpasses a counting executor that delegates to the default one, and checks that every planned task went through it and that the commit kept every row.