Repository navigation
Add test: No test coverage for skip_unused_shards through nested views - #101284
clickgapai wants to merge 2 commits into
Conversation
| SET force_optimize_skip_unused_shards = 1; | ||
|
|
||
| -- Nested views: outer_view -> inner_view -> remote() | ||
| CREATE VIEW inner_view_04070 AS SELECT * FROM remote('127.0.0.1:19000,127.0.0.1:19000', currentDatabase(), data_04070, key % 2); |
There was a problem hiding this comment.
@clickgapai Port for SQL queries is 9000. If you want to execute the query on 2 nodes then you can rewrite it in the following way:
| CREATE VIEW inner_view_04070 AS SELECT * FROM remote('127.0.0.1:19000,127.0.0.1:19000', currentDatabase(), data_04070, key % 2); | |
| CREATE VIEW inner_view_04070 AS SELECT * FROM remote('127.0.0.{1,2}:9000', currentDatabase(), data_04070, key % 2); |
The same applies to the other queries
There was a problem hiding this comment.
This finding's branch may be deleted or its PR closed, so I can't act on it directly. If you'd like the same change applied to a new PR, open it (or ask me to file a separate PR via a fresh comment on the original PR).
|
Workflow [PR], commit [3d3358c] Summary: ❌
|
|
@clickgapai are you going to address the issue in this comment #101284 (comment) ? Or should I fix it for you? |
|
Fixing this now. All |
@clickgapai I don't see any new commits from you |
|
This finding's branch may be deleted or its PR closed, so I can't act on it directly. If you'd like the same change applied to a new PR, open it (or ask me to file a separate PR via a fresh comment on the original PR). |
|
Dear @devcrafter, 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. |
|
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. |
|
@groeneai can you take this up and open a new PR? |
|
Taking this up. Triaged against master Verified: It will be re-filed as part of an area-grouped PR rather than its own PR, to keep reviewer load down (26 in this batch plus 18 from the earlier one today). Full triage and the grouping plan: #101781 (comment) |
|
Declining this one from the batch, with the measurement. The rest of its group is re-filed as #114296 (#101781, #103935, #103939). Two findings, and the second is the decisive one. The original does not run as written: it fails with But the coverage gap is not there. The behaviour comes from
Worth recording why my own first sweep said the gap was real: I keyed it on the setting name, asking which tests combine |
Re-files three closed clickgapai coverage PRs (ClickHouse#101781, ClickHouse#103935, ClickHouse#103939) that @ zlareb1 asked to be reopened. A fourth, ClickHouse#101284, is not included: its mechanism is already pinned by five existing tests, so it would be a duplicate. Each branch was mutated, rebuilt and re-run to confirm the test detects it, and each mutation had to leave the pre-existing tests of the same mechanism green so that reddening is evidence of incremental coverage rather than of the mechanism merely being live. Two of the three originals failed that check: - ClickHouse#101781 asserted count() = 3 after the writer merged. The pre-merge state is also 3 rows, so a run in which the refresh never happened is indistinguishable from a correct one. An active-part count is no better: refreshDataPartsOnce commits the merged part with the same Transaction::commit that demotes the parts it covers, upstream of grabOldParts, so the active set is 1 in both directions. The test now asserts the part state through the _state virtual column, which is Deleting on master and Outdated when grabOldParts is not asked to force removal. The refresh is driven by SYSTEM RESTART DISK, which calls the same body synchronously, so no sleep is needed, and the writer's merges are bracketed by SYSTEM STOP/START MERGES so its own scheduler cannot merge the three inserts before the first assertion. - ClickHouse#103939 asserted count() <= 10 while a REPLACE PARTITION and a mutation raced for ten seconds. That passes whenever the race is not won, which is the likely outcome; measured against a binary with the guard broken, it still passes. It is replaced by a deterministic sequence: the REPLACE is parked inside its own intent window on the existing rmt_cancel_removed_parts_check_pause_in_gap failpoint, reached from replacePartitionFrom via cancelRemovedPartsCheck while the intent is held, and the test then asserts the mutation entry's postpone_reason in system.replication_queue. That column is the one the guard writes; system.mutations.parts_postpone_reasons carries a different vocabulary fed only by the merge-selection path, so polling it would never observe this. ClickHouse#103935 was sound and is adopted close to as written. Only its cited line was stale: the override is at AggregatingTransform.cpp:150, not :143. The coverage gaps were measured against the mechanism rather than the setting name, which is what the ClickHouse#101284 duplicate turned on. None of the four refresh_parts_interval tests ever merges, no test asserts read_rows after an external GROUP BY spills through any observable, and no test contains the intent guard's message. no-parallel is on the replication test only, and is earned rather than assumed: run concurrently with itself the untagged form fails because a second copy consumes the once-only pause, while the tagged form passes. The other two carry no such tag and were run concurrently with themselves to confirm it.
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
Retrospective finding from a historical scan of PR #98754 (merged 2026-03-05). Confirmed on current codebase — close with a note if already fixed.
Adds test coverage for 1 untested code path(s), found during automated review of PR #98754.
1. No test coverage for skip_unused_shards through nested views, UNION ALL views, views with column renames, or views with aggregation
src/Planner/Planner.cpp:287,src/Storages/StorageView.cpp:182Changelog 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
Found during review of PR #98754.