Repository navigation
Add test: Merge-path projection rebuild does not test _row_exists propagation into the pre-calculate slim block - #106359
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [decdbcd] Summary: ✅ AI ReviewSummaryThis PR adds a stateless regression test for the vertical lightweight-delete merge path rebuilding projections with Findings
Final Verdict
|
Add an unused payload column (sole gathering column) and set vertical_merge_algorithm_min_rows/columns_to_activate=1 so chooseMergeAlgorithm picks Vertical; otherwise the horizontal path applies the deleted-row mask before calculateProjections and the _row_exists propagation goes untested. Requested by @clickhouse-gh[bot] in ClickHouse#106359 (comment)
|
The failures of They were introduced by #104690 ("Add #104690 was merged in violation of the ClickHouse team rules: its own CI already showed these two tests failing (10 times between May 12 and June 1) before it was merged. Please update your branch to pick up the revert; the tests should pass again. |
|
Thanks — agreed, the diagnosis matches. This PR only touches master into the branch to pick up the revert in #106365; once CI re-runs on the updated base those two tests should be green again. I'll watch the |
|
ClickGap AI Bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
| vertical_merge_algorithm_min_rows_to_activate = 1, | ||
| vertical_merge_algorithm_min_columns_to_activate = 1; | ||
|
|
||
| INSERT INTO t_lwd_merge_proj SELECT number, number % 3, number FROM numbers(100); |
There was a problem hiding this comment.
This can still pass without ever exercising the merge-path rebuild. Nothing here prevents the two inserted parts from auto-merging before the DELETE, and in that case the table reaches the mutation with only one active part. The final OPTIMIZE TABLE ... FINAL then has no two-part projection rebuild left to do, so the force_optimize_projection check still passes while covering only the mutation path.
Please pin the part topology for this scenario: SYSTEM STOP MERGES before the inserts, SYSTEM START MERGES only when you are ready to run the explicit OPTIMIZE, and ideally assert that two active parts are still present after the delete.
There was a problem hiding this comment.
At least it tests with a high probability.
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 67 line(s) across 33 file(s) · Details Top files
|
|
Dear @CurtizJ, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Add an unused payload column (sole gathering column) and set vertical_merge_algorithm_min_rows/columns_to_activate=1 so chooseMergeAlgorithm picks Vertical; otherwise the horizontal path applies the deleted-row mask before calculateProjections and the _row_exists propagation goes untested. Requested by @clickhouse-gh[bot] in ClickHouse#106359 (comment)
…pr100047 Add test: Merge-path projection rebuild does not test `_row_exists` propagation into the pre-calculate slim block
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #100047.
That PR The PR adds a pre-calculate squashing step in both the merge (
MergeTask::ExecuteAndFinalizeHorizontalPart::calculateProjections) and mutation (PartMergerWriter::mutateOriginalPartAndPrepareProjections) projection-rebuild paths. Source blocks are accumulated into a sharedSquashingbuffer (size1. Merge-path projection rebuild does not test
_row_existspropagation into the pre-calculate slim blocksrc/Storages/MergeTree/MergeTask.cpp:1254,src/Storages/MergeTree/MergeTask.cpp:1293Risk:
calculateProjectionsbuilds a slim block of only the projections' required columns;MergeTask.cpp:1253-1254additionally inserts_row_existswhen present, whichprojection.calculateuses to skip deleted rows. Reached viaprepareProjectionsToMergeAndRebuild(line 1157-1159) whenmerge_may_reduce_rowsis set byhasLightweightDelete(line 663). RISK: if this insert is dropped/refactored, the projection rebuilt during merge would include lightweight-deleted rows while the main part …What's unique vs PR tests: The PR's only test (projection_materialize.xml) is a performance test with no assertions, a plain aggregating projection, and NO lightweight deletes, so it never produces a block with
_row_existsand never exercises the merge-path rebuild filter. Existing lwd+projection stateless tests (03161/03254/03571) never OPTIMIZE FINAL after a lightweight delete, so the merge-path_row_existsslim-block insert is uncovered everywhere.Tags:
-- Tags: no-random-merge-tree-settings—no-random-merge-tree-settings: Test asserts exact projection-served counts and depends on the explicit lightweight_mutation_projection_mode='rebuild' and min_bytes_for_wide_part=0 merge-tree settings; randomized merge-tree settings could perturb part layout/merge behavior and the asserted counts.Try it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Version info
26.7.1.797(included in26.7and later)