Repository navigation
Add projection merge introspection to system.merges - #102611
Merged
Merged
Conversation
Contributor
|
Workflow [PR], commit [e14a6e9] Summary: ✅ AI ReviewSummaryThis PR adds projection-stage introspection to ClickHouse Rules
Final Verdict
|
amosbird
force-pushed
the
merge-projection-progress
branch
from
April 13, 2026 19:11
c79436b to
d233fba
Compare
amosbird
force-pushed
the
merge-projection-progress
branch
2 times, most recently
from
April 14, 2026 02:33
8f9f220 to
8ffef0b
Compare
amosbird
force-pushed
the
merge-projection-progress
branch
2 times, most recently
from
April 14, 2026 05:25
abb2d14 to
76277f9
Compare
amosbird
force-pushed
the
merge-projection-progress
branch
from
April 14, 2026 06:44
76277f9 to
1298e42
Compare
amosbird
force-pushed
the
merge-projection-progress
branch
5 times, most recently
from
April 15, 2026 07:33
c373793 to
bd6907b
Compare
amosbird
force-pushed
the
merge-projection-progress
branch
7 times, most recently
from
April 16, 2026 04:57
7d8b3f7 to
924fb11
Compare
Projection merges were completely invisible in `system.merges` — each projection sub-merge created a standalone `MergeListElement` that was never registered in the global `MergeList`, so the parent merge's progress stalled during the projection stage with no indication of what was happening. Add six new columns to `system.merges`: - `current_projection` — name of the projection currently being merged or rebuilt, empty when not in the projection stage. - `current_projection_progress` — row-level progress 0..1 of the current projection sub-merge. - `current_projection_parts_merging` — number of parts being merged in the current projection sub-merge step. - `current_projection_parts_remaining` — number of parts remaining for the current projection. - `projections_completed` — projections finished so far in this merge. - `projections_remaining` — projections still pending. Progress is reported via `parent_progress` pointer in child `MergeListElement`: child writes its progress to parent's `current_projection_progress` atomically. This is lifetime-safe because parent always outlives child. The introspection covers three code paths: 1. Merged projections (`MergeProjectionsStage::executeProjections`) 2. Rebuilt projections (`executeMergeProjections` via `MergeProjectionPartsTask`) 3. Mutation projection rebuilds (`PartMergerWriter::iterateThroughAllMergeSubtasks`) Also restores `future_part.path` for projection sub-merges, which was commented out with a TODO pending introspection support. Add `merge_task_projection_stage_pause` failpoint (PAUSEABLE) and a functional test that creates a table with two projections, triggers a merge, and pauses at each projection transition to verify the introspection columns.
amosbird
force-pushed
the
merge-projection-progress
branch
from
April 16, 2026 09:35
924fb11 to
bd60853
Compare
1 task done
Contributor
LLVM Coverage Report
Changed lines: 97.68% (253/259) | lost baseline coverage: 2 line(s) · Uncovered code |
CurtizJ
approved these changes
May 26, 2026
CurtizJ
enabled auto-merge
May 27, 2026 11:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Projection merges were completely invisible in
system.merges— during the projection stage, the parent merge's progress stalled with no indication of what was happening. This adds four new columns to expose projection merge state in real time.Changes:
current_projection,current_projection_progress,projections_completed,projections_remainingcolumns tosystem.mergesMergeListElement(protected by mutex), updated from both the merge and rebuild code paths inMergeTaskfuture_part.pathfor projection sub-merges (was commented out with a TODO)merge_task_projection_stage_pausefailpoint (PAUSEABLE) for testingChangelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add
current_projection,current_projection_progress,projections_completed, andprojections_remainingcolumns tosystem.mergesto expose projection merge progress.Documentation entry for user-facing changes
Version info
26.6.1.185