Skip to content

Fix LOGICAL_ERROR in normal projection optimization with correlated subqueries - #111401

Closed
groeneai wants to merge 40 commits into
ClickHouse:masterfrom
groeneai:fix-normal-projection-correlated-subquery-outputport
Closed

groeneai wants to merge 40 commits into
ClickHouse:masterfrom
groeneai:fix-normal-projection-correlated-subquery-outputport

Conversation

@groeneai

@groeneai groeneai commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #103695 (same Invalid number of columns in chunk pushed to OutputPort error family)

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix a LOGICAL_ERROR raised when a normal projection was used to read the input of a correlated subquery (decorrelated into a join) and all parts were served from the projection. Depending on the settings it was reported as Invalid number of columns in chunk pushed to OutputPort or as Block structure mismatch in joined block stream. It is an exception in release builds and aborts the server in debug and sanitizer builds.

Description

Found by the AST fuzzer, reproduces on current master and is unrelated to the pull requests it was seen on: amd_msan (STID 2270-3452), amd_tsan (STID 0993-3a3c), and Stress test (arm_debug).

Root cause: optimizeUseNormalProjections reads the projection over required_columns = reading->getAllColumnNames(). Columns of that set which the rebuilt query.dag does not consume survive as pass-throughs, because ActionsDAG::updateHeader appends every un-consumed input, and widen the rewritten read's output header. The all-parts-from-projection branch spliced that widened node in without the blocksHaveEqualStructure check the Union branch already had, so a downstream step got more columns than its declared header.

Change: emit the replaced header's columns by name, dropping the surplus pass-throughs so the projection stays usable, and hoist the equal-structure check to cover both replacement branches. It stays below the narrowing as a fail-closed net for what narrowing cannot repair (a missing column, or a type difference), skipping the projection and keeping the regular read. Since filterPartsByProjection mutates the parent analysis result in place, it now runs only after that check passes, so a skipped projection no longer drops parts; has_parent_parts moves ahead of it and is computed non-destructively.

Validation: the load-bearing regression test is 03324_union_block_structure_mismatch. Reverting only this change makes its first statement fail with PROJECTION_NOT_USED; that statement previously carried -- { serverError PROJECTION_NOT_USED }, so the projection is now used where it was refused before. 04410 and 04907 pin the plan shape via EXPLAIN: every read served by the projection, none declined, no base-table arm. The 04410 carriers abort on the commit the fuzzer reports came from, but not at the current merge-base, where an earlier pass prevents the widening; they are kept as plan-shape pins, not as the proof. The failing-test set across the projection, prewhere, part_offset and correlated suites is unchanged. 05054_normal_projection_output_header_mismatch pins the fail-close side of the hoisted check: the failpoint normal_projection_skip_output_header_conversions disables both header conversions, so the same rewrite the test's baseline accepts reaches the check with a mismatch, and the statement flips to PROJECTION_NOT_USED under force_optimize_projection = 1 while the surviving read still returns every row.

Both carriers: error signatures

Carrier 1, virtual columns (_part_offset in the projection), output port assert:

Invalid number of columns in chunk pushed to OutputPort. Expected 2, found 4
src/Processors/Port.h:425
src/Processors/Transforms/JoiningTransform.cpp:101  DB::JoiningTransform::prepare()

Carrier 2, real columns. The inner decorrelation join's right side carries exactly one column by design, so the leaked columns trip its structure check instead of the output port one:

Block structure mismatch in joined block stream: different number of columns:
__table3.timestamp UInt64 UInt64(size = 0)
__table3.timestamp UInt64 UInt64(size = 2), payload String String(size = 2), id UUID Sparse(size = 2, UUID(size = 1), UInt64(size = 0))

src/Core/Block.cpp:863   DB::assertBlocksHaveEqualStructureAllowReplicated
src/Interpreters/ConstantJoin.cpp:230   DB::ConstantJoin::addBlockToJoin
src/Processors/Transforms/JoiningTransform.cpp:373  DB::FillingRightJoinSideTransform::work()

correlated_subqueries_use_in_memory_buffer = 0 selects the ConstantJoin assert; adding correlated_subqueries_default_join_kind = 'left' selects the output port one. Runnable reproducers for both are the statements in the new test file.


Workflow [PR]
Sync PR [sync-upstream/pr/111401]

…ubqueries

optimizeUseNormalProjections sets required_columns = getAllColumnNames().
Columns in that set not consumed by the rebuilt query.dag survive as
pass-throughs (ActionsDAG::updateHeader appends every un-consumed input) and
widen the projection-rewritten read output header. The all-parts-from-projection
branch (parts_with_ranges.empty()) spliced that widened node into the plan
without the makeMaterializingDAG + blocksHaveEqualStructure guard the Union
branch already had. When such a read feeds the input of a correlated subquery
decorrelated into a join, the JoiningTransform pushed a chunk with more columns
than its declared output header, aborting the server with 'Invalid number of
columns in chunk pushed to OutputPort' (STID 2270-3452, found by the AST fuzzer).

Hoist the materialize-constants + equal-structure guard so it protects both
replacement branches; on a structure mismatch skip the projection and keep the
regular read. filterPartsByProjection mutates the parent analysis result in
place, so restore the pre-filter result on the skip path to avoid dropping rows.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The reproducer in the description aborts the server 100% on master (debug/sanitizer) at JoiningTransform.cpp:101; one concrete statement, fires every run.
b Root cause explained? Yes. optimizeUseNormalProjections sets required_columns = getAllColumnNames(); inputs not consumed by the rebuilt query.dag survive as pass-throughs (ActionsDAG::updateHeader appends un-consumed inputs), widening the projection read header. The all-parts-from-projection branch spliced that widened node without the blocksHaveEqualStructure guard the Union branch had, so the decorrelation join's JoiningTransform pushed an extra-column chunk.
c Fix matches root cause? Yes. The materialize + equal-structure guard now protects both replacement branches; on mismatch the projection is skipped and the correct regular read is kept. Fixed at the optimizer that produces the widened header, not at the JoiningTransform symptom.
d Test intent preserved / new test? Yes. New regression test 04410_normal_projection_correlated_subquery_part_offset asserts (1) no logical error and (2) projection-on results equal projection-off results (guards the skip path against dropping rows). No existing test weakened.
e Both directions demonstrated? Yes. Fails (logical error / abort) without the fix, passes with it; 50/50 randomized runs clean.
f General, not a narrow patch? Yes. The guard covers any un-consumed pass-through column in the all-parts branch (the Union branch already had it), not just _part_offset. The distinct #100332 fuzzer query (correlated scalar subquery + PROJECTION (SELECT * ORDER BY x), no _part_offset) also stops failing.
g Generalizes across inputs/wrappers? Yes. The guard operates on block structure via blocksHaveEqualStructure (name + type incl. wrappers) and makeMaterializingDAG (const vs materialized). Verified with LowCardinality(Int32) and Decimal(9,2)/Int8 inputs.
h Backward compatible? Yes. No setting default, on-disk/wire/metadata format change. Only adds a skip-on-mismatch path that falls back to the already-correct regular read. No SettingsChangesHistory entry needed.
i Invariants / contracts preserved? Yes. The fix enforces the OutputPort header contract that was being violated. Filtering + query-access-info now run only after the check passes, so a skipped projection neither drops parts from the regular read nor is reported as selected in system.query_log / EXPLAIN projections = 1. Regression-guarded: the parallel-replica projection test 01710_normal_projection_fix1 passes.

Session id: cron:clickhouse-author-slot-3:20260722-123300

@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

Independent second-model review of the resulting code before opening this PR. Each finding was adjudicated and verified against the code.

⚠️ Majors

  • Deep-copy of the range analysis on every successful rewrite — AGREE. The first draft snapshotted the full AnalysisResult to roll back on skip. Removed it: has_parent_parts is now computed by intersecting parts_with_ranges with best_candidate->parent_parts (no mutation), and filterPartsByProjection runs only after the structure check passes, so the skip path mutates nothing and needs no rollback.
  • Rejected projection reported as selected — AGREE. addQueryAccessInfo now runs after the structure check, and on skip the candidate's stat description is rewritten, so system.query_log.projections / EXPLAIN projections = 1 no longer claim a skipped projection was used.
  • Randomized settings could bypass the tested path — AGREE. The runner may disable optimize_use_projections / query_plan_remove_unused_columns; the test now pins both so it deterministically exercises the projection + header-narrowing path.

💡 Nits

  • Unjustified no-random-merge-tree-settings tag — AGREE. The CREATE already pins index_granularity and the merge-size cap that fix the 5-part layout; verified stable across merge-tree setting perturbations. Tag removed.
  • "crash" wording for a logical error — AGREE. Reworded: a LOGICAL_ERROR is an exception in release builds (aborts only in debug/sanitizer builds).

Adjudicated but not applied (DISAGREE, with evidence)

  • "Reorder the header check before filterPartsByProjection to avoid the copy entirely" — DISAGREE. Moving the check earlier reads projection_reading->getOutputHeader() before the remote-replica NullSource fallback, where it can be null, and segfaults 01710_normal_projection_fix1 (parallel-replica projection path). The header check must run after that fallback; the intersection-based has_parent_parts (above) avoids the copy without moving the check.

Session id: cron:clickhouse-author-slot-3:20260722-123300

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @novikd @CurtizJ — could you review this? It fixes a LOGICAL_ERROR ("Invalid number of columns in chunk pushed to OutputPort", STID 2270-3452) where optimizeUseNormalProjections splices a widened projection read (un-consumed pass-through columns) into the all-parts branch without the equal-structure guard the Union branch already has, so a correlated-subquery decorrelation join receives an extra-column chunk. The guard now protects both branches and skips the projection on a structure mismatch.

@clickhouse-gh

clickhouse-gh Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e95f98d]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_debug, parallel) FAIL
05054_embedded_rocksdb_explicit_dir_file_grant FAIL cidb
05054_embedded_rocksdb_explicit_dir_file_grant FAIL cidb
05054_embedded_rocksdb_explicit_dir_file_grant FAIL cidb
Stateless tests (arm_binary, parallel) FAIL
05054_embedded_rocksdb_explicit_dir_file_grant FAIL cidb
05054_embedded_rocksdb_explicit_dir_file_grant FAIL cidb
05054_embedded_rocksdb_explicit_dir_file_grant FAIL cidb
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/new_tests_check.py FAIL
Parser memory check ERROR
Resolve master binary ERROR
Build (amd_darwin) DROPPED
Build (arm_darwin) DROPPED
Build (arm_v80compat) DROPPED
Build (amd_freebsd) DROPPED
Build (ppc64le) DROPPED
Build (amd_compat) DROPPED

AI Review

Summary

This PR fixes the normal-projection rewrite when the projection stream is wider than the subplan it replaces: it narrows surplus pass-through columns before the shared blocksHaveEqualStructure guard, keeps filterPartsByProjection and projection-access recording below the commit point, and adds focused regressions for the mixed-Union, all-parts accept, and all-parts fail-close paths. I reviewed the current PR-head diff together with the full prior discussion, and I did not find any remaining blockers or majors.

Missing context / blind spots
  • ⚠️ I could not re-run the targeted stateless tests locally: the workspace is checked out as a synthetic pull/111401/merge ref with no ready build directory, and the historical S3 CI artifacts linked from the PR are expired (403). The verdict is therefore based on the committed PR-head sources, the added tests, and the full review-thread history.
Final Verdict

✅ No new findings.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 22, 2026
…rase

The analyzer has been the default since 24.3, so the check_style
"analyzer wording" pass bans "new analyzer" in comments. Reword line 2
of 04410_normal_projection_correlated_subquery_part_offset (both .sql and
.reference, kept identical for echo mode) to "the analyzer".

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@StackSlayerAI

Copy link
Copy Markdown
Contributor

CI Triage (bot) — head 22843990 — 2026-07-22

Verdict: REAL FAILURE — AST fuzzer LOGICAL_ERROR crash; integration test flake

AST fuzzer (amd_debug, targeted): Server crash (exit code 134) with:

Fail [Logical error: Trying to extract chunk from ChunkBuffer before all inputs are finished (unfinished inputs: A) (STID: 2651-2cfd)]

This is a LOGICAL_ERROR in the query pipeline execution. PR #111401 fixes a LOGICAL_ERROR in normal projection optimization with correlated subqueries — the fuzzer may be triggering a related or adjacent code path.

Integration tests — test_replicated_database/test_replicated_table_structure_alter: This test PASSED on retry (first run failed, second passed), indicating a flake unrelated to this PR.

Action needed: Investigate the ChunkBuffer LOGICAL_ERROR in the AST fuzzer log — it may be a pre-existing issue exposed by the PR's changes to projection optimization, or a new regression introduced.

Run ID: 29939580700

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — 2284399

Every failure below has an owner. None are PR-caused on this head: the Style-check
"new analyzer" wording violation and the Finish Workflow / Post Hooks rollup failed
only on the earlier commit f142a39a; the subsequent comment-only reword commit
22843990773c clears Style, and all remaining reds on this head are pre-existing,
unrelated to this PR (a normal-projection correlated-subquery OutputPort fix).

Check / test Reason Owner / fixing PR
Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6) / test_check_table::test_check_all_tables chronic flaky (32 master + 60 PRs / 30d) a fix task is moved to pending (investigating at full effort; fixing-PR link to follow here)
Integration tests (amd_asan_ubsan, db disk, old analyzer, 3/6) / test_replicated_database::test_replicated_table_structure_alter known flaky, tracked in #110036 #111029 (external, open)
AST fuzzer (amd_debug, targeted) / Logical error: Trying to extract chunk from ChunkBuffer before all inputs are finished (STID 2651-2cfd) pre-existing trunk correlated-subquery decorrelation logical error (0 master, scattered fuzzer PRs / 30d) #108554 (ours, open)
PR rollup of the above owned via the lines above

Session id: cron:our-pr-ci-monitor:20260723-023000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the test_check_all_tables flaky (Integration amd_asan_ubsan, db disk, old analyzer): #111353 (merged 2026-07-22, backported to 26.7 by #111574).

The failure is the plain-rewritable metadata_dropped concurrent-create race, not anything in this PR. Every occurrence after that merge is on a build whose base predates it: I checked all 49 distinct commits that produced this failure since 2026-07-22 17:31Z, and 49 of 49 lack the fix. Merging master into this PR picks it up. Details: #111477 (comment)

groeneai and others added 4 commits July 28, 2026 18:53
The hoisted structure guard in optimizeUseNormalProjections was verified against
one more carrier of the same defect, found by the AST fuzzer on an unrelated pull
request (STID 0993-3a3c, AST fuzzer (amd_tsan) on ClickHouse#92472; also seen in
Stress test (arm_debug) on ClickHouse#108289).

Same root cause as the case already covered: ActionsDAG::updateHeader appends
every input the rebuilt query.dag does not consume, so unconsumed columns of
required_columns survive as pass-throughs and widen the projection-rewritten
stream past the header of the subplan it replaces. What differs is the consumer.
Here the leaked columns are real (not virtual), and the parent is the right side
of the inner correlated-decorrelation join, whose contract is a single column
(payload and id belong to the outer stream). So instead of the output port check
in JoiningTransform::prepare, the widened block trips the right-side structure
assert in ConstantJoin::addBlockToJoin. Which of the two fires depends only on
the settings: correlated_subqueries_use_in_memory_buffer = 0 gives the
ConstantJoin one, additionally setting correlated_subqueries_default_join_kind to
'left' gives the output port one.

Reproduced on unmodified master for both asserts, byte-identical to the CI
report (message, column dump including the sparse id column, and the whole frame
chain). It only surfaces when query_plan_remove_unused_columns is off, because
that optimization re-narrows the stream; CI reached it through
compatibility = '25.3'.

No source change was needed: removing only the hoisted blocksHaveEqualStructure
block from the fixed build makes both asserts fire again with the original
messages, and restoring it rebuilds bit-identically, which is what proves the
existing guard is what covers this carrier. The check was deliberately made on
the branch merged with current master rather than by comparing prebuilt binaries
of different vintages, since ConstantJoin.cpp does not exist at this branch's
original merge base.

The test pins query_plan_remove_unused_columns = 0 (otherwise the check is
vacuous), keeps id sparse-serialized and asserts that it is, and compares
projection-on against projection-off results so the skip path is shown to lose no
rows. No randomization tags are needed: 100 randomized runs pass.

While verifying this I confirmed that issue ClickHouse#112128 (correlated EXISTS under OR
with full_sorting_merge) is a different producer of the same symptom, since it is
unaffected by optimize_use_projections = 0. It is tracked separately.
The regression statements for the second carrier are result-based: they pass
whenever the normal projection is not used, including in a hypothetical world
where the candidate is declined earlier than the hoisted structure check (for
example if has_all_required_columns started failing, or if the read-in-order
precondition stopped holding). They prove the queries do not abort, but not
that the guard this change adds is what makes them pass, so the test could
silently stop exercising it.

Add, for each of the two detector statements, a companion assertion on the
stat description the skip path writes, using the same settings clause so the
plan path is identical:

    SELECT count() > 0
    FROM (EXPLAIN projections = 1 <same SELECT, same SETTINGS>)
    WHERE explain ILIKE '%does not match the structure it replaces%';

It asserts a boolean over one stable substring rather than plan text, so it
does not churn with the plan format. Deleting only the two lines that set the
description flips exactly these two assertions and leaves every pre-existing
assertion green, so they are the sole carriers of the reachability claim.

Also pin max_bytes_to_merge_at_max_space_in_pool = 1 on the second fixture,
matching the mechanism the first fixture in the same file already uses. The
two small parts cannot be selected for merging within the test's lifetime
today, so this is not a redness fix; it removes the shipped test's dependence
on merge-selector arithmetic that a future change could invalidate silently.

Co-Authored-By: Claude Fable 5 <[email protected]>
…check

The reachability assertions added for the real-column carrier used
count() > 0 over the whole EXPLAIN output. That is an existence test, and
a single plan legitimately holds reads with opposite verdicts: in these
queries the outer read uses the projection while only the nested read is
rejected at the structure check. The assertion therefore proved "some
candidate was rejected somewhere" rather than "the read under test hit
the check", and would have stayed green if the rejection moved to an
unrelated read.

Count the occurrences instead. Exactly one read reaches the check in each
of the three statements, measured on the build under test, so an equality
pins the rejection to that read without forbidding the outer read's
legitimate use of the projection.

The virtual-column carrier had only result-based assertions, which pass
whenever the projection is not used at all, including when the candidate
is declined earlier than the structure check. It now carries the same
assertion, mirroring the settings of the statement it follows.

Verified by deleting only the two lines that rewrite the skipped
candidate's stat description: the reference then differs in exactly three
places, all three of the new counts flipping to 0, while every
result-based assertion stays green. That is what shows the three
assertions are the sole carriers of the reachability claim.
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (4 rounds, 22 findings adjudicated: 13 agreed, 6 refuted with evidence, 2 dropped, 1 split)

Every change in this pull request was reviewed by an independent model before
publication, separately from the session that wrote it. Findings are recorded
with a verdict and the evidence that settled it.

❌ Blockers / majors that were fixed

finding round what it was how it was resolved
projection-guard-liveness 1 Every assertion was result-based, so all of them would stay green if the projection candidate were declined EARLIER than the hoisted structure check. The test could not tell whether the guard was still being exercised. Added, for each detector statement, a companion assertion on the stat description that the skip path writes, in the SELECT count() ... FROM (EXPLAIN projections = 1 ...) WHERE explain ILIKE '%...%' form. A mutation deleting only the two description-setting lines flips exactly those assertions and nothing else.
projection-guard-liveness-r2 2 The count() > 0 form was an existence test over the whole plan text, and one plan legitimately holds reads with opposite verdicts: the outer read uses the projection while the nested read is the rejected one. So the assertion did not tie the rejection to the read that reaches the check. Carrier 1 had no plan assertion at all. Rewrote both assertions as count() = 1 after measuring the constant, and added the same form for carrier 1. The over-broad half of the suggested remedy ("prove the projection is not selected") was rejected: it would be wrong for carrier 1, whose outer read legitimately uses the projection.
live-description-stale 4 The published description still described the first version of this change: it omitted the second carrier entirely, and it said the skip path "restores the pre-filter result", a mechanism the code never had. The code reorders instead, so that the structure check runs before filterPartsByProjection mutates the analysis result. The description was rewritten to match the shipped change and re-checked claim by claim against the code: the non-mutating has_parent_parts computation, the stat-description rewrite, both carriers' asserts, and the masking effect of the query_plan_remove_unused_columns default.

⚠️ Claims that were checked and refuted, with the evidence

  • "A skipped projection is not reported as selected in system.query_log, and
    nothing tests that."
    The mechanism was raised correctly, and the review then
    asked for a test. Measuring first showed the claim is not observable through
    that channel for this defect at all, so the sentence was removed from the
    description instead of being asserted. Query access info is a query-wide
    deduplicated set of <database>.<table>.<projection> strings, and every
    consumer of it is also a set, so there is no per-read entry and no
    multiplicity to observe. A projection can only be a candidate if it covers the
    parent read's full column set, which is exactly the width that causes this bug,
    so any projection reaching the rejected inner read is also offered to the outer
    read of the same table and contributes the same key regardless of ordering.
    Confirmed empirically: an A/B between the fixed build and a build with only the
    access-info call moved back above the guard reports the identical single entry
    in both, so a negative assertion would fail on the fixed build and a positive
    one would detect nothing. Twenty-three fixtures across six designs were tried;
    dropping the outer columns instead makes the correlated column unresolvable.
    The ordering is still documented at the guard, where it is accurate.

  • "The two tiny parts are eligible for an automatic merge, so the fixture is
    racy."
    Refuted generally rather than by sampling: for a 2-part range
    SimpleMergeSelector::allow computes (S1+S2+2C)/(max(S1,S2)+C) with
    C = 5 MiB, which is at most 2 for all sizes, while lowered_base is at
    least 2.0; with 2 parts the base is only lowered after
    max_age_to_lower_base_at_min_size = 3600 s and the test finishes in about
    0.3 s. Every escape hatch was checked and none is randomized. The suggested
    pin was adopted anyway, purely for consistency with the first fixture in the
    same file, so the shipped test does not depend on selector arithmetic.

  • "The new test aborts on the current debug build, so the fix does not
    work."
    The abort came from a different binary: the build id in the cited log
    matches another worktree's binary, the connection went to a port that does not
    belong to this task, and the guard string is absent from that binary's source.
    The same review log shows the query planning successfully, with the rejection
    present and no abort, once a guard-bearing server was reached.

  • A merge-tree randomization concern. Justified from code, not only from the
    100 randomized runs: ClientBase::addMergeTreeSettings appends an injected
    merge-tree setting only when the DDL did not already set it, and both settings
    these fixtures depend on are set in the CREATE TABLE.

💡 Noted, not blocking

  • count() = 1 bounds the number of guard rejections in the plan but does not
    identify which read reached the guard, because the projection description is
    printed per candidate with no read identity on the matched line. Identifying
    the read would require matching plan-text structure, which churns with the
    plan format; the bounded count was preferred deliberately.
  • One carrier-1 statement legitimately reports zero rejections, because in its
    plan both reads use the projection, so no candidate reaches the structure
    check. It correctly ships without a reachability assertion.
  • A third carrier found during this work (correlated EXISTS under OR with
    full_sorting_merge) is a different producer: this fix does not change its
    behaviour, and optimize_use_projections = 0 does not gate it. It is tracked
    separately rather than widened into this pull request.

@groeneai

Copy link
Copy Markdown
Collaborator Author

Updated for the second carrier added since the first version of this pull request; supersedes the gate comment posted on 2026-07-22.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, on demand, no fuzzer. SET enable_analyzer = 1, allow_experimental_correlated_subqueries = 1; then the carrier-2 CREATE/INSERT/SELECT from the description, run with read_in_order_two_level_merge_threshold = 1, query_plan_remove_unused_columns = 0, correlated_subqueries_use_in_memory_buffer = 0 - aborts every run on an unmodified master debug build. Adding correlated_subqueries_default_join_kind = 'left' switches it to the OutputPort assert. compatibility = '25.3' is what restores those settings in the CI job, which is why the fuzzer hit them there.
b Root cause explained? Yes. optimizeUseNormalProjections passes required_columns = reading->getAllColumnNames(); ActionsDAG::updateHeader appends every input the rebuilt query.dag does not consume, so those columns survive as pass-throughs and the projection-rewritten stream is WIDER than the subplan it replaces. The all-parts-from-projection branch spliced that node in without a structure check (only the Union branch had one), so a consumer received a block with more columns than its declared header and its structure assert fired. query_plan_remove_unused_columns = 1 (the default) masks it by re-narrowing the stream.
c Fix matches root cause? Yes, producer side. The guard is hoisted so both replacement branches keep the rewritten stream structurally equal to what it replaces, and the projection is skipped when it cannot. No assert relaxed, no consumer taught to tolerate a wide block, no setting pinned as a workaround. filterPartsByProjection was moved after the check, so a skipped projection no longer drops parts from the regular read; that ordering is what the projection-on equals projection-off oracles verify. addQueryAccessInfo sits after the check as well, so a skipped candidate is not recorded as selected, though that half is not separately observable in a test: query access info is a query-wide deduplicated set, and any projection reaching the rejected read is also offered to the outer read of the same table.
d Test intent preserved / new tests added? Yes. 04410_normal_projection_correlated_subquery_part_offset keeps every original statement, and its reference is a supersequence of the published one: all 32 published lines survive in order, and the only rewritten lines are the echoes of the two assertions this round strengthened. It gains the second carrier: both asserts, a projection-on equals projection-off oracle, an assertion that id is really stored with the sparse serialization, and three EXPLAIN projections = 1 assertions, one for each carrier statement that reaches the check, so the result-based statements cannot silently stop exercising the guard. Each counts occurrences and asserts = 1 rather than > 0, because one plan legitimately holds reads with opposite verdicts: the outer read uses the projection while only the nested read is rejected, so an equality ties the rejection to the read under test where an existence test would not. SQL test, not a unit test. No no-parallel (the table lives in the test's own database). No no-random-settings / no-random-merge-tree-settings: verified over 100 randomized runs, and both merge-tree settings the fixture depends on are set in the DDL, which runner injection never overrides.
e Both directions demonstrated? Yes. Unmodified master: both asserts abort (the message, the column dump including id UUID Sparse, and the whole frame chain match the CI report byte for byte); this branch merged with current master: both run cleanly and the test passes. Removing only the hoisted structure check from the fixed build makes both abort again with the original messages, and restoring it rebuilds bit-identically. A second, narrower mutation that deletes only the two lines writing the skipped candidate's stat description flips exactly the three EXPLAIN assertions from 1 to 0 and changes nothing else, which is what proves those assertions pin reachability rather than merely the absence of an abort; the restore after it rebuilds bit-identically too. Weakening one of those assertions back to > 0 leaves every result value unchanged, which documents that the equality is the strictly stronger form rather than a cosmetic edit. Every run was Build-ID verified against the server, connecting on this slot's own port.
f Fix is general across code paths? Yes. Both replacement branches of optimizeUseNormalProjections are guarded, and both asserts of the leaked stream are covered by one producer-side fix (ConstantJoin's second assert on the selected-row path is covered for free, since the block never becomes wide). Sibling check: optimizeUseNormalProjection.cpp is the only file under src/Processors/QueryPlan/Optimizations/ that splices a replacement node into iter->node->children[...]; optimizeUseAggregateProjection.cpp adapts its consumer instead, or inserts a converting step for the DISTINCT case, and was probed clean empirically. One genuinely different producer of the same symptom was found while verifying this (correlated EXISTS under OR with full_sorting_merge, issue #112128): it is unaffected by optimize_use_projections = 0, so it is not a projection-substitution bug and is deliberately out of scope here.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. The guard compares block structure, so it is type-agnostic, and makeMaterializingDAG runs first so a const-versus-materialized difference is converted rather than rejected. The tests cover both correlated_subqueries_* settings, LowCardinality columns (carrier 1) and a sparse-serialized UUID (carrier 2, asserted), virtual and real column sets, and both plan shapes: all parts from the projection (the splice branch) and only some parts (the Union branch). The in-memory-buffer path (the current default) was probed and does not leak.
h Backward compatible? Yes. No new setting, no default change, no serialization or protocol change, so no SettingsChangesHistory.cpp entry is needed. The only behaviour change is that a query which raised a logical error now returns correct results; when the guard rejects a projection the regular read is kept, so results are unchanged and only the previously broken optimization is skipped.
i Invariants and contracts preserved? Yes, and the guarded property is itself the contract: a rewritten subplan must keep the output structure its parent declared. The skip path is ordered so the in-place mutation of the parent analysis result (filterPartsByProjection) and the query-access-info record happen only after the check passes; has_parent_parts is computed non-destructively with std::any_of beforehand. The projection-on equals projection-off assertions are the row-level proof that the skip path loses nothing. Plan-time single-threaded code, so no locking or concurrency contract is touched.

Session id: cron:clickhouse-impl-slot-5:20260729-015900

groeneai added 2 commits July 29, 2026 06:50
The projection-on/off equality for the aggregate statement held whenever the
projection was not used, including when it was declined before the hoisted
structure check. Both result lines then stayed equal and the assertion stopped
proving that running filterPartsByProjection after the check preserves rows.

The existing reachability assertion covers the "= 8" statement only; the
aggregate has a different plan shape (unrestrictive predicate, four parts
instead of one), so it needs its own. Measured with a mutation that declines
the candidate before the check: the four reachability assertions all flip to 0
while every projection-on/off equality stays equal, which is the gap being
closed. A mutation restoring the pre-fix ordering turns the aggregate result
into 0 0 0, so the row-preservation half stays live as well.
Applies the repository convention from `.claude/CLAUDE.md` to the comments this
change added: literal names from the ClickHouse SQL language, classes and
functions, and literal excerpts from log messages go in inline code blocks.

Comment-only across both files. The optimization's compiled `.text` is
unchanged, and the echoed reference file is regenerated so it stays in sync
without any result row moving.
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 6833b78

174 check-runs, all completed, 1 failed. It has an owner.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 01666_merge_tree_max_query_limit not caused by this PR: the throttle the test asserts is keyed on query id, and a parallel-replicas read sends an empty query id, so the holder query competes against itself and is rejected instead of holding the slot. This PR touches only normal-projection optimization and its own new test #112385 (mine, merged 2026-07-29 15:37Z). This build predates that merge, so the branch still needs master merged in to pick it up

Every other Bugfix validation job on this head is green or correctly skipped, and the earlier
Style check and Post Hooks reds were cleared on this commit.

Session id: cron:our-pr-ci-monitor:20260729-190000

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - ab209b8

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (arm_asan_ubsan) / Hung check failed, possible deadlock found not a deadlock: the one hung row is a plain SELECT count() FROM test WHERE b > ... AND b < ... at 776s that had selected 99999 marks and issued 15594 reads with 15592 FileOpens to move 536 KB out of the local cache file, so it is read amplification on the cached compact-column path, still making forward progress a fix task is created (investigating at full effort, fixing-PR link to follow here)

All 174 check-runs on this head are completed; the only failure is the row above.

Not caused by this PR: the diff is optimizeUseNormalProjection.cpp plus one new stateless
test pair, with nothing in the filesystem cache, the remote-FS gather reader, or
MergeTreeReaderCompact. The hung thread is on-CPU under a ThreadFuzzer
sched_setaffinity injection rather than blocked on a lock, and is_cancelled = 1 is the
harness cancelling it, not the defect.

Session id: cron:our-pr-ci-monitor:20260730-003000

The four EXPLAIN oracles counted the projection reads and checked that no
read was declined, which both hold on a mixed UnionStep plan as well: such a
plan keeps the same two ReadFromMergeTree (p) / (p_by_session) lines and adds
a base-table arm beside each. Measured on both carriers, with a mixed-parts
table built by materializing the projection and then attaching a part that
has none: shipped oracle 1 on all-parts and 1 on mixed, so a regression away
from the all-parts replacement kept the file green. With the third conjunct
the oracles read 1 on all-parts and 0 on mixed.

This is the assertion already used by 04907 for the same distinction.

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 6d1036a

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_asan_ubsan, distributed plan, parallel, selected tests) infra: test selection aborted, CIDB ... TOO_MANY_SIMULTANEOUS_QUERIES retried 5x within the same second (no backoff on the non-OK response path) #115436 (external, open)
Stateless tests (amd_asan_ubsan, db disk, distributed plan, sequential, selected tests) same, second shard of the same job #115436 (external, open)
Finish Workflow / Post Hooks (new_tests_check.py) consequence: both Bugfix validation functional arms were DROPPED by the praktika dependency cascade from the two jobs above, so no arch could validate the bug #115436 (external, open)

All three rows are one causal chain, not three defects. ci/praktika/cidb.py CIDB.query
sleeps only in its except branch, so a 5xx response retries five times with no delay
(10:07:21 on all five attempts); the two selected tests jobs therefore ERROR at
Failed to select tests, praktika marks their dependees DROPPED due to previous failure
(106 nodes, including both Bugfix validation (functional tests, *)), and new_tests_check.py
correctly reports that no per-arch job validated the bug. #115436 adds the missing
time.sleep(2**retry) to the non-OK-response path, which closes the root cause.

The fix is not yet merged, so this build could not carry it. This PR's diff touches one optimizer
file and three test files, none of them CI harness code.

Session id: cron:our-pr-ci-monitor:20260819-160000

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 5a7f4ba

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (arm_debug) / Bucket 0 is pushed twice (STID 2508-47d5) pre-existing trunk logical error in GroupingAggregatedTransform, aborts at MergingAggregatedMemoryEfficientTransform.cpp:62; 3 rows across 3 unrelated PRs since 2026-08-18, 0 master #114523 (external, open)

Bugfix validation (functional tests, amd64) and (aarch64) also carry FAIL rows for
04907_normal_projection_materialize_constants and
04410_normal_projection_correlated_subquery_part_offset. Those are not failures: both jobs
concluded success, and the FAIL rows are the master-binary arm, which must fail for the
validation to prove the regression tests catch the bug. On the PR side the same two tests are
318 OK / 314 OK across 20 job flavours each, including Fast test and
Fast test (arm_darwin).

The owner above is a linkable open fix rather than a task because #114523 modifies exactly the
aborting translation unit (MergingAggregatedMemoryEfficientTransform.cpp, plus
AggregatingStep.h) and adds
04869_distributed_plan_partial_aggregation_bucket_order. Merged #112794 is already an ancestor
of this head and the assert still fires with it present, so it is not linked here.

Report:
Stress test (arm_debug)

Session id: cron:our-pr-ci-monitor:20260820-040000

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Merged master into the branch (f114a2152d4b, clean merge, no conflicts). This picks up #114523 (merged 2026-08-21), the fix for the only red on the previous head — Stress test (arm_debug) / Bucket 0 is pushed twice (STID 2508-47d5) — so that failure should clear on the next CI run. Verified locally after the merge: incremental build is clean and all three test files (03324_union_block_structure_mismatch, 04410_normal_projection_correlated_subquery_part_offset, 04907_normal_projection_materialize_constants) match their references.

… the Union plan shape

The AI review verdict asked to make `03324_union_block_structure_mismatch`
stay on the mixed `UnionStep` path deterministically and to assert the
base-table `ReadFromMergeTree` arm:

- Disable merges on the fixture table
  (`max_bytes_to_merge_at_max_space_in_pool = 1`), so the projection-less
  part written before `ADD PROJECTION` can never be merged with the
  projection-carrying one, which would silently collapse the mixed `Union`
  plan into the all-parts rewrite.
- Pin the mixed-parts state itself: two active parts in `system.parts`,
  exactly one row for projection `x` in `system.projection_parts`.
- Extend the `EXPLAIN projections = 1` oracle to require exactly one
  `Union`, one projection read arm `ReadFromMergeTree (x)`, and one
  surviving non-projection `ReadFromMergeTree` arm, in addition to the
  absence of the structure-mismatch decline message.

Verified locally: the test is diff-clean against its reference, and the
extended oracle returns 0 when `optimize_use_projections = 0` (negative
control), so it still discriminates.

ClickHouse#111401

Co-Authored-By: Claude Fable 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - f488916

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 03324_union_block_structure_mismatch reference mismatch, deterministic (Failed 3 out of 3 reruns, diff -1 / +0 on the 4th line) PR-caused, fixed in this PR

Notes on the arithmetic, so the omissions are auditable:

  • The two Bugfix validation (functional tests, amd64 / aarch64) legs carry CIDB FAIL rows at
    this commit, and both jobs concluded pass. Those rows are the check working as designed
    (the regression test is required to fail without the fix), so they are passengers rather than
    failures and get no owner column.
  • Config Workflow, Style check and Finish Workflow are all green, and no check is
    queued or in progress, so this is a complete run rather than a dropped matrix.
  • The failure is not flaky: 3 of 3 reruns failed on that leg, the test file is in this PR's
    diff, and 30-day breadth is 2 rows across 2 pull requests with no true-master occurrence.
    03324 passes 250 of 250 runs across the five flaky check flavours at this same commit,
    so the non-determinism is specific to the ParallelReplicas + s3 + coverage leg.

Session id: cron:our-pr-ci-monitor:20260825-180000

The `amd_llvm_coverage, ParallelReplicas, s3 storage, parallel` job installs
tests/config/users.d/enable_parallel_replicas.xml, which turns
`enable_parallel_replicas` on in the default profile. That breaks the two tests
in two independent ways.

Normal projections are unsupported when reading over parallel replicas unless
`parallel_replicas_local_plan` is on and aggregation in order is off
(projectionsCommon.cpp), and tests/clickhouse-test randomizes both settings. So
the `force_optimize_projection = 1` query in 03324 raises PROJECTION_NOT_USED,
and the projection-read assertions in 04907 return 0, on the configurations the
runner happens to roll.

Independently, reading over parallel replicas wraps the plan in an outer `Union`
of the local plan and `ReadFromRemoteParallelReplicas`. The plan-shape assertion
added to 03324 in "Address review: make 03324 mixed-parts state deterministic
and assert the Union plan shape" requires exactly one `Union`, so it counted 2
and returned 0. That is the `-1 / +0` reference diff on the fourth line seen in
CI. The mixed projection `Union` the test pins was intact and nested inside: the
projection arm, the surviving base-table arm and the absence of a structure
decline all held on that job.

Pinning `enable_parallel_replicas = 0` at session scope in both tests keeps them
about the plans they were written for. This is what 238 other stateless tests
already do.

Verified against a server started with that job's parallel-replicas profile:
before, 03324 failed with the same fourth-line diff and 04907 failed two
assertions; after, both pass with the profile off and on, across all four
combinations of the two randomized settings. Both remain live - with
`makeNarrowingDAG` made to decline, 03324 fails with PROJECTION_NOT_USED, and
with the hoisted structure check made to decline, 04907 fails both assertions.

04410 was checked over the same four combinations and needs no pin.
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pushed cccbf98 for the Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) failure on 03324_union_block_structure_mismatch (Failed 3 out of 3 reruns, -1 / +0 on the fourth line).

That job installs tests/config/users.d/enable_parallel_replicas.xml, which turns enable_parallel_replicas on in the default profile, and that breaks the test two independent ways:

  • The plan-shape assertion requires exactly one Union. Reading over parallel replicas wraps the plan in an outer Union of the local plan and ReadFromRemoteParallelReplicas, so the count is 2. The mixed projection Union it pins is intact and nested inside: the projection arm, the surviving base-table arm, and the absence of a structure decline all hold on that job.
  • Normal projections are unsupported when reading over parallel replicas unless parallel_replicas_local_plan is on and aggregation in order is off (projectionsCommon.cpp:89-100), and tests/clickhouse-test randomizes both. So the force_optimize_projection = 1 query raises PROJECTION_NOT_USED on some rolls.

Fix is SET enable_parallel_replicas = 0 at session scope in 03324, as 238 other stateless tests already do. 04907_normal_projection_materialize_constants had the same second problem (both projection-read assertions returned 0) and got the same pin; its reference gains only the echoed SET lines, no assertion value moved.

Verified against a server running that job's parallel-replicas profile: before, 03324 reproduced the same fourth-line diff; after, both tests pass with the profile off and on, across all four combinations of the two randomized settings. Both are still live: with makeNarrowingDAG forced to decline, 03324 fails with PROJECTION_NOT_USED; with the hoisted structure check forced to decline, 04907 fails both assertions.

04410 needs no pin. Its correlated subqueries do not use parallel replicas at all, so the unsupported-projection branch is never reached: ReadFromRemoteParallelReplicas occurrences in the cited query's plan are 0, while an ordinary read of the same table under the same profile gives 1. It passed all four combinations and six repeats of the most hostile one.

Tests only, src/ is untouched.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 4d82c4d

Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose
fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Upgrade check (amd_release) / Cannot start clickhouse-server not PR-caused, CI-harness defect on master: tests/config/install.sh symlinks silk.xml with no version gate, so the previous-release server rejects enable_silk_runtime with Code: 137 ... UNKNOWN_ELEMENT_IN_CONFIG and never starts. Onset is a cliff at 2026-08-30 13:48:57Z (65 rows / 64 distinct PRs in 7 days, 0 true-master rows, still firing at 19:06Z) #117172 (ours, open)
Upgrade check (amd_release) / Check failed the same job's second abort row (Check failed with exit code 1), same task_url, same event as the line above #117172 (ours, open)

No other check failed at this head, and none of the failures is PR-caused: the diff here touches
normal-projection planning and its tests, not tests/config/.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111401&sha=4d82c4d92704673be5720596a11584a9e2c772c2&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

Session id: cron:our-pr-ci-monitor:20260830-190000

…write

The hoisted `blocksHaveEqualStructure` check is the last safety net for an
all-parts rewrite whose rewritten output cannot be repaired by
`makeNarrowingDAG` / `makeMaterializingDAG`, and no stateless test pinned it:
all three regressions in this pull request assert accept paths.

A query cannot reach the branch. Both conversions refuse only on headers the
analyzer never builds for a `MergeTree` read (duplicate column names), and a
type difference raises inside `ActionsDAG::updateHeader` before the check, so
the branch has no natural carrier. Add the failpoint
`normal_projection_skip_output_header_conversions`, which disables both
conversions, so the very rewrite the new test's baseline accepts reaches the
check with a surplus pass-through column and must be declined there.

The new test `05054_normal_projection_output_header_mismatch` pins the flip:
the same statement uses the projection with the conversions in place, returns
`PROJECTION_NOT_USED` under `force_optimize_projection = 1` once they are
disabled, and still reads every row of the table afterwards - with and without
`optimize_use_projections` - so a declined rewrite provably keeps all parts.
@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Dear @novikd, 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.

@novikd novikd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the tests reproduces any issue (Bugfix validation did not work). Tests are working on the latest release: https://fiddle.clickhouse.com/4588be18-8cf6-436e-9e8f-d787c36b89d4
I'd recommend closing this PR

@novikd novikd self-assigned this Sep 2, 2026
@groeneai

groeneai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

You are right about the two new tests, and I agree the PR as titled is not supported.

One correction on the CI. Bugfix validation did run, on the three commits before the current head, and returned OK on both arches (amd64 report for 1c80b554, aarch64 identical). Per its status model (the comment above bugfix_validation_ft_pr_jobs in ci/defs/job_configs.py) OK means the bug reproduced on master HEAD, and the per-test rows in that report are post-inversion: invert_bugfix_validation_status in ci/jobs/functional_tests.py flips a master-HEAD FAIL to OK and an OK to FAIL. So 04410 and 04907 read FAIL there, meaning they passed on master HEAD and reproduce nothing, exactly as you found. The single row that counted as a reproduction was 03324_union_block_structure_mismatch, which on master 26.9.1.407 failed with Code: 584. DB::Exception: No projection is used when optimize_use_projections = 1 and force_optimize_projection = 1. (PROJECTION_NOT_USED) thrown from optimizeTree.cpp:762. On the current head e95f98d all five legs are skipped, so the commit you reviewed carries no validation signal at all.

Which is to say: the only thing that reddens without this change is a projection being refused, not the logical error in the title. That agrees with what I measured on this branch earlier (#111401 (comment)): 112 instrumented arrivals at the blocksHaveEqualStructure site across all 193 in-tree stateless tests that mention PROJECTION, zero header mismatches, and a structural reason why SQL cannot produce one. The logical error reproduced on the commit the fuzzer found it on and no longer does at the merge base, as the description states.

So what is left is an improvement (a projection master declines becomes usable) plus a defensive guard, not Bug Fix (user-visible misbehavior in an official stable release). I have no objection to closing it. @ alexey-milovidov has commits on this branch including one from this morning, so the disposition is yours and his; if either of you would rather keep the narrowing, 03324 is the only test that measures it.

@groeneai

groeneai commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - e95f98d

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_debug, parallel) / 05054_embedded_rocksdb_explicit_dir_file_grant trunk defect, deterministic here (8/8 with this run's own randomized settings, 17/17 with randomization off) #117651 (external, merged 2026-09-02T11:07:18Z), not in the built tree: rule 3c
Stateless tests (arm_binary, parallel) / 05054_embedded_rocksdb_explicit_dir_file_grant same trunk defect (8/8, then 19/19 with randomization off) #117651 (external, merged 2026-09-02T11:07:18Z), not in the built tree: rule 3c
Parser memory check / Resolve master binary infra: the master clickhouse-examples artifact was not found under the new S3 layout #117701 (mine, merged 2026-09-02T16:49:23Z), not in the built tree: rule 3c
Sync - CH Inc sync (private, not actionable by me)

Both owners merged AFTER these jobs started (the two stateless legs began 10:32:10Z and 10:34:34Z,
the revert landed 11:07:18Z), so neither fix could be in the tree that was built. The 102 dropped
dependents are a cascade from the two rows above rather than a verdict on this diff, and
Finish Workflow only rolls them up. 05054_embedded_rocksdb_explicit_dir_file_grant was firing on
44 distinct pull requests and on master (440 rows, 162 of them true-master) inside one 2h17m window
on 2026-09-02, and #117651 deleted the test outright, so a master merge clears both rows and re-runs
the dropped matrix. I am not pushing that merge myself: the head here is your own commit and you
have taken every master merge on this branch so far, so it is yours to time.

Session id: cron:our-pr-ci-monitor:20260903-163000

@clickhouse-gh clickhouse-gh Bot added the comp-projections Projections: precomputed layouts for accelerating queries (projection parts, maintenance). label Sep 4, 2026
@groeneai

groeneai commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

The reproducer behind this PR no longer fails on master: @ alexey-milovidov measured it on 384f59b5e2c and I reproduced it on 319bfd73ff35, where the plan headers agree on their own, so the throw site is gone without this change.

I measured what the remaining src change still does on today's master and concluded it is not worth keeping: #112128 (comment). Your recommendation stands as far as I am concerned, no objection to closing.

@novikd novikd closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-projections Projections: precomputed layouts for accelerating queries (projection parts, maintenance). groeneai-origin-follow-up PR origin: groeneai's own out-of-scope finding during its PR work pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants