Skip to content

Decide parallel replicas eligibility with the subquery's own context - #110020

Merged
alexey-milovidov merged 12 commits into
ClickHouse:masterfrom
groeneai:groeneai/fix-pr-view-over-mergetree-per-query-setting
Oct 11, 2026
Merged

alexey-milovidov merged 12 commits into
ClickHouse:masterfrom
groeneai:groeneai/fix-pr-view-over-mergetree-per-query-setting

Conversation

@groeneai

@groeneai groeneai commented Jul 10, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #100815

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):

Parallel replicas now honor a SETTINGS clause that changes table eligibility when it is written inside a subquery or a view body. Such a clause was ignored, so a query over a view whose body sets parallel_replicas_for_non_replicated_merge_tree = 0, or sets parallel_replicas_allow_view_over_mergetree = 0 and reads a further view, returned max_parallel_replicas times too many rows, and a UNION over a view overriding parallel_replicas_allow_view_over_mergetree per subquery could throw Can't determine table for parallel replicas.

Description

One root cause in three traversals: parallel-replicas table eligibility was decided with the OUTER query's context, while the read executes with the per-(sub)query context a SETTINGS clause applies to.

Wrong results. StorageView::getUnderlyingMergeTreeStorageForParallelReplicas walked a view's resolved inner tree with a single captured outer context, so a SETTINGS clause in the view body was ignored and the view was still judged eligible. Each follower then read the whole table locally and the initiator concatenated those results, so SELECT count() silently returned max_parallel_replicas times too many rows. Two settings carry that opt-out: parallel_replicas_for_non_replicated_merge_tree, and parallel_replicas_allow_view_over_mergetree once the body reads a further view.

Logical error. In a UNION whose subqueries read a view over MergeTree, getSupportingParallelReplicasQueries decided eligibility with the outer context while findTableForParallelReplicas re-decided it while descending. A per-subquery override made the two disagree: a subquery was chosen but no eligible table found. Found by the AST fuzzer, Stress test (amd_debug) on master, STID 3634-4123: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=06136dac55ba4fb8544dc1697cd28b2ef769eb17&name_0=MasterCI&name_1=Stress%20test%20%28amd_debug%29

The fix tracks the enclosing (sub)query context in all three traversals, and refuses a nested view whose enclosing body disallows a view over MergeTree. Neither half works alone: the planner half removes the inflated counts, the storage half the UNION-in-a-view logical error that the buggy helper had been suppressing.

No new setting or default change, so no SettingsChangesHistory.cpp entry. The nested-view cases keep using parallel replicas, coordinated on the underlying MergeTree table instead of the view. Validated on a 3-replica cluster: 04728 fails without the fix and passes with it, over 100 randomized runs.


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

Version info

  • Merged into: 26.10.1.2097-master (included in 26.10 and later)

…a view over MergeTree

In a UNION whose subqueries read a view over MergeTree, the parallel-replicas
decision (getSupportingParallelReplicasQueries / findQueryForParallelReplicas)
evaluated view eligibility with the top query context, while the plan build
(findTableForParallelReplicas) re-evaluated it while descending into the chosen
subquery. When a subquery overrode parallel_replicas_allow_view_over_mergetree
via per-query SETTINGS, the two disagreed: the decision picked a candidate but
the build found no eligible table, throwing LOGICAL_ERROR (server abort in
debug/stress builds).

Track the enclosing (sub)query context while descending in both traversals so
per-subquery SETTINGS are honored consistently in the decision and the build.

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. SELECT 1 FROM v SETTINGS parallel_replicas_allow_view_over_mergetree=0 EXCEPT SELECT 1024 FROM v SETTINGS parallel_replicas_allow_view_over_mergetree=1 (view over MergeTree, parallel_replicas cluster) aborts every time.
b Root cause explained? The parallel-replicas DECISION path (getSupportingParallelReplicasQueries) evaluated view eligibility with the top query context (setting=1 → eligible, picks a candidate subquery), while the BUILD path (findTableForParallelReplicas) re-evaluated it with the chosen subquery's own context (per-query SETTINGS ...=0 → ineligible → no table). The two disagreed → LOGICAL_ERROR at findParallelReplicasQuery.cpp:629.
c Fix matches root cause? Yes. Both traversals now track the enclosing (sub)query context (QueryNode/UnionNode::getContext()) while descending, so per-subquery SETTINGS are honored consistently in decision and build.
d Test intent preserved / new tests added? New regression test 04401_parallel_replicas_view_over_mergetree_per_query_setting. No existing test weakened.
e Demonstrated both directions? Yes. Pristine build: server SIGABRT, test FAILS. Fixed build: test PASSES, parallel replicas still works when the view is eligible (count=1000).
f Fix general, not a narrow patch? Yes. Fixed BOTH sibling traversals (decision + build) that share the same context-tracking bug; JOIN branches also carry the correct per-branch context.
g Generalizes across inputs? Verified across the trigger matrix: front-branch eligible → ok; front ineligible-by-setting + later eligible → was the crash; plain table (no view) → ok. Applies to any per-subquery override of the eligibility settings, not just the fuzzed literal.
h Backward compatible? Yes. No setting default, format, or behavior change; only makes the PR decision honor already-existing per-subquery SETTINGS.
i Invariants/contracts preserved? Yes. The invariant that the decision and build agree on the chosen parallel-replicas table is now upheld; traversal shape and node-type handling unchanged.

Session id: cron:clickhouse-worker-slot-3:20260710-153800

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @nickitat @devcrafter — could you review this? It fixes a LOGICAL_ERROR Can't determine table for parallel replicas where the parallel-replicas candidate decision and the plan build evaluated view-over-MergeTree eligibility with different contexts, so a per-subquery SETTINGS parallel_replicas_allow_view_over_mergetree override in a UNION made the two disagree.

@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Jul 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2e7e50b]

Summary: ✅


AI Review

Summary

This PR fixes the parallel-replicas context mismatch in the planner and the matching view-eligibility bug in StorageView, so per-subquery and view-body SETTINGS are evaluated with the context the replicas actually execute. The current code now threads the effective Context through the touched traversals, rejects nested view carriers when the enclosing body disables them, and the added stateless tests cover both the LOGICAL_ERROR regression and the wrong-results cases. I did not find any remaining correctness, compatibility, or evidence gaps worth blocking on.

Final Verdict

✅ Approve. No new inline findings.

LLVM Coverage Report

Measured on commit 2e7e50b.

Metric Baseline Current Δ
Lines 88.60% 88.60% +0.00%
Functions 92.10% 92.10% +0.00%
Branches 80.90% 81.00% +0.10%

Changed lines: Changed C/C++ lines covered: 77/79 (97.47%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jul 10, 2026
Tag the test long and shrink the fixture from 1000 to 10 rows. The crash
this test reproduces is triggered by the per-query parallel_replicas_allow_view_over_mergetree
mismatch across UNION subqueries over a view, which is independent of row
count, so a tiny fixture still deterministically hits it. The long tag
exempts the test from the 180s flaky-check limit and reduces its repeat
count, fixing the TSan flaky-check timeout.

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

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — 9550ec3

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) / 04401_distributed_with_fill_const_to_scalar flaky (13+ master + 35+ unrelated PRs in 30d; unrelated to this PR's parallel-replicas view diff) #110060 (ours, open)
PR / Mergeable Check (aggregators) reflect the above #110060 (ours, open)

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

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 11b9d3e

Every failure below has an owner: a fixing PR, or a full-effort fix task whose
fixing-PR link will be posted here when it opens.

Check / test Reason Owner / fixing PR
Stateless tests (amd_llvm_coverage, ParallelReplicas, s3 storage, parallel) / 01666_merge_tree_max_query_limit flaky on this lane: secondary replicas are built without setQueryId, so the per-table max_concurrent_queries throttle sees several random query ids for one statement and the query competes against itself #112385 (ours, open)

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

@alexey-milovidov alexey-milovidov mentioned this pull request Jul 31, 2026
1 task done
# Conflicts:
#	src/Planner/findParallelReplicasQuery.cpp
@clickhouse-gh

clickhouse-gh Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.50% 86.50% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 78.70% 78.70% +0.00%

Changed lines: Changed C/C++ lines covered: 51/52 (98.08%) · Uncovered code

Full report · Diff report

@groeneai

groeneai commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 2982e4c

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.

CI is fully finished at this head: 174 check-runs, 156 success, 18 skipped, zero failures.
Finish Workflow and Config Workflow both succeeded, so there is no failure line to own.

Check / test Reason Owner / fixing PR
(none) - no failing check at this commit

Session id: cron:our-pr-ci-monitor:20260801-233000

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a LOGICAL_ERROR (“Can't determine table for parallel replicas”) that could occur when parallel-replicas eligibility for a view-over-MergeTree is affected by per-subquery SETTINGS inside UNION/set-operation queries, by ensuring both the candidate-selection and table-finding traversals evaluate eligibility with the correct enclosing (sub)query context.

Changes:

  • Track and propagate the current (sub)query Context while descending query-tree nodes when selecting parallel-replicas candidate subqueries.
  • Track and propagate the current (sub)query Context while descending query-tree nodes when locating the eligible table for parallel replicas (including JOIN branch traversal).
  • Add a stateless regression test covering per-subquery overrides of parallel_replicas_allow_view_over_mergetree across set operations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Planner/findParallelReplicasQuery.cpp Keep per-subquery Context aligned between candidate selection and build-time table discovery to avoid mismatched eligibility decisions.
tests/queries/0_stateless/04401_parallel_replicas_view_over_mergetree_per_query_setting.sql New regression test reproducer for per-subquery SETTINGS divergence in set operations over a view on MergeTree.
tests/queries/0_stateless/04401_parallel_replicas_view_over_mergetree_per_query_setting.reference Expected output for the new regression test.

Address the Copilot review on this PR.

Drop the `no-parallel-replicas` and `long` tags from
04401_parallel_replicas_view_over_mergetree_per_query_setting.

`no-parallel-replicas` made the test vacuous in exactly the configuration it
exists for. tests/clickhouse-test:2788 skips a test carrying that tag when the
runner is given `--no-parallel-replicas`, and that flag is what the
`ParallelReplicas` job passes (ci/jobs/functional_tests.py:173). So the two
`amd_llvm_coverage, ParallelReplicas, s3 storage, {parallel,sequential}` jobs
were the only ones exercising the parallel-replicas server profile, and the tag
excluded the test from both. CIDB confirms it: on head 2982e4c the test is
SKIPPED there with "smth is not supported with parallel replicas".

`long` was not needed either. The tag was added when the fixture was
numbers(1000), together with the shrink to numbers(10) that actually fixed the
180s flaky-check failure. The threshold at :3453 compares a single run's
duration, not the sum over reruns, and the test now takes about 3s. The tag also
cost coverage of its own: it reduces the flaky-check repeat count to 10% (:4270,
--long-test-runs-ratio 0.1) and makes every `--no-long` job skip the test
(:2837), which is what the SKIPPED "not running long tests" rows on
Fast test and several coverage jobs show.

Both tags had to go together: the two ParallelReplicas jobs are also
`--no-long` jobs, since `amd_llvm_coverage` sets is_llvm_coverage and the
non-per-test-coverage branch appends `--no-long`
(ci/jobs/functional_tests.py:532). Removing only one tag would have left the
test skipped there for the other reason.

Also reword two comments that described the failure as a crash. It is a
LOGICAL_ERROR exception, handled in release builds, and the abort only happens
in debug and sanitizer builds. Trim the two comments in
findParallelReplicasQuery.cpp to the local invariant, since the motivation and
the root cause belong in the commit message rather than in the source.
Now that the test is no longer tagged `no-parallel-replicas`, it is subject to
setting randomization, and two gaps let it pass without exercising the fix.

Pin `automatic_parallel_replicas_mode = 0`. The randomizer picks mode 2 with
probability 0.25 (tests/clickhouse-test:1615), and that mode only collects
statistics instead of using parallel replicas (:1699-1702). Measured on a
master binary without this fix: with mode 2 injected the test returned 0 and
passed, so roughly a quarter of runs would have silently tested nothing. With
the setting pinned the same binary fails again (the in-test SET takes
precedence over runner injection). Pin `parallel_replicas_local_plan` too,
which is randomized at :1554.

Assert the plan actually keeps `ReadFromRemoteParallelReplicas` for the
eligible-view query. The previous assertions were all on result values, which
hold just as well when the planner declines parallel replicas and runs
locally, so they could not distinguish the fix from a silent fallback. Checked
that the new assertion discriminates: it yields 1 with parallel replicas
enabled and 0 with them disabled.

Verified against the pre-fix binary with both randomized values of
`automatic_parallel_replicas_mode` injected: the test fails in both cases.
Add a plan assertion for `parallel_replicas_allow_view_over_mergetree = 0`, so a
guard that silently stopped honoring the setting would be caught.

The discriminator is not whether parallel replicas run at all: measured, the
remote step is present for both values of the setting, so an assertion
requiring no `ReadFromRemoteParallelReplicas` step on the disabled path is not
satisfiable. What the setting changes is which relation the remote step reads.
Enabled it sends `SELECT count() ... FROM default.v_pr_view`, disabled it sends
the rewritten inner query over `default.mt_pr_view`. This matches how
04077_pr_view_union_ineligible distinguishes eligible from ineligible views.

Checked that the new assertion can fail: it yields 0 as written and 1 when the
view is sent for a query that disabled the setting.
StorageView::getUnderlyingMergeTreeStorageForParallelReplicas walked the
view's resolved inner query tree with a single captured outer context, so a
SETTINGS clause written inside the view definition was ignored when deciding
whether the underlying MergeTree table is eligible for parallel replicas.

A view whose body sets parallel_replicas_for_non_replicated_merge_tree = 0 was
therefore still read through the coordinated remote path, while each follower
evaluated StorageMergeTree::read with its own view-body context, found the
setting disabled, and read the whole table locally. The initiator concatenated
those full results, so the query silently returned max_parallel_replicas times
too many rows.

Thread the effective context through the find_storage lambda: take it as a
parameter, refresh it from QueryNode::getContext at QUERY and
UnionNode::getContext at UNION, and forward it to the UNION branch recursion,
the nested-view recursion and isTableNodeEligibleForParallelReplicas. The
parameter form is used rather than a mutated local so that one UNION branch's
context cannot leak into the next.

This mirrors the rule already applied to the outer planner traversals in
findParallelReplicasQuery.cpp.
The block restated the motivation that already lives in the previous commit
message. Keep only what a reader needs at that spot.
Covers a single-level view, a nested view, three UNION shapes and FINAL, with
both the returned values and the relation that is shipped to the replicas.

parallel_replicas_local_plan is deliberately left to the runner's randomization
rather than pinned: every assertion was measured identical at both values, so
not pinning is strictly stronger coverage than the sibling 04066 form.

The structural assertions are the fails-without-fix oracle: they differ on
master for all four opt-out shapes at both values of that setting. The value
rows are a correctness check, not the oracle, because the inflation a broken
build produces is not deterministic across runs.
@groeneai

groeneai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - f2edec9

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
AST fuzzer (amd_debug, targeted) / Logical error: ColumnBLOB should be converted to a regular column before usage (STID 3059-4608) Trunk bug, not caused by this branch: a local-shard plan in a distributed query marshals its blocks, so a ColumnBLOB reaches a regular consumer. Fuzzer query is SELECT ... FROM (SELECT DISTINCT ... FROM cluster('test_cluster_two_shards_localhost', ...)). Breadth over 30 d: 68 rows / 44 PRs / 6 master rows #111997 (mine, open)
Build (arm_release) / Post Hooks CI harness: build_profile_hook.py telemetry upload fails in prepare-time-trace.sh (LogCluster warning). Job-level check_status = success (the hook carries allow_failure), so the build itself is green. Breadth over 7 d: 1712 rows / 368 PRs / 1193 master rows a fix task is moved to pending (investigating at full effort - fixing-PR link to follow here)

156 success, 18 skipped, 1 failure out of 175 check-runs. Finish Workflow succeeded.

Session id: cron:our-pr-ci-monitor:20260803-200000

@groeneai groeneai changed the title Fix logical error "Can't determine table for parallel replicas" with a view over MergeTree Decide parallel replicas eligibility with the subquery's own context Aug 3, 2026
@groeneai

groeneai commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (2 findings, both disagreed with evidence)

An independent model reviewed this diff cold against the PR contract. Both findings are about the
tests, and I disagree with both. Recording them here with the measurements, since a reviewer may
reasonably wonder the same things.

⚠️ 04728 leaves parallel_replicas_local_plan randomized

The claim: because tests/clickhouse-test:1554 randomizes this setting 0/1, the new test's
assertions are nondeterministic and one path of the fix could go untested. The suggested remedy is
to pin it.

Disagree. The assertions were measured at both values before the setting was deliberately left
free, 20 repetitions per cell, and they are identical:

view lp=0 lp=1 expected
v_plain v_plain, 300 v_plain, 300 v_plain, 300
v_set empty, 300 empty, 300 empty, 300
v_nested empty, 300 empty, 300 empty, 300
v_union mt_g2, 600 mt_g2, 600 mt_g2, 600
v_union_both empty, 600 empty, 600 empty, 600
v_final empty, 300 empty, 300 empty, 300

Zero variance per cell and no difference between the two values, so there is nothing for the
randomization to destabilize. The pre-fix arm is red at both values as well (v_set and
v_nested return 900 instead of 300 and name the view instead of nothing), so no path is left
untested at either value. End to end: 100 of 100 randomized runs pass, and system.query_log
confirms the randomizer really did exercise both values rather than silently taking one (1727
queries at 0, 4804 at 1).

Pinning it would remove randomization coverage that is currently green rather than add determinism
that is currently missing. Note 04401 in this same PR does pin it: there the oracle was measured
to be sensitive to the value, so the pin is load-bearing. Same reasoning, opposite conclusion, both
driven by measurement rather than by a blanket rule.

⚠️ 04401's disabled-setting probe could pass via a fully local fallback

The claim: the disabled arm counts only remote-plan rows naming v_pr_view, and a completely local
plan would also yield zero, so the probe does not prove the promised underlying-table path.

Disagree on the premise. That exact question was measured while this assertion was being
written: ReadFromRemoteParallelReplicas is present for both values of
parallel_replicas_allow_view_over_mergetree. The setting changes what is shipped (enabled sends
FROM default.v_pr_view; disabled sends the rewritten inner query over default.mt_pr_view), not
whether parallel replicas run. A fully local fallback is not a state this query reaches, so it
cannot be the reason the count is zero. Both arms were also mutation-tested in the round that added
them: the enabled arm goes 1 to 0 with parallel replicas disabled, and the disabled arm goes 0 to 1
if the guard stops honoring the setting.

The stronger form the review suggests, asserting mt_pr_view by name on the disabled arm, is a fair
increment and matches the shape 04077_pr_view_union_ineligible uses. It is not a correctness gap
in what is here, so I have not changed that file in this round.

Also checked and clean

Context threading is a parameter rather than a mutated capture, so a UNION branch cannot leak its
context into a sibling; union_node.getContext() is safe to seed from because
QueryTreeBuilder.cpp:201 builds it from a copy of the enclosing context, so no outer override is
lost. The join_contexts stack is in strict lockstep with join_nodes (two pushes, one paired pop).
All three external callers of the helper already pass their own outer context, so none needed
changing. automatic_parallel_replicas_mode = 0 is load-bearing, not boilerplate: mode 2 is picked
in 25% of runs and only collects statistics, under which every assertion would pass without
exercising the paths under test.

Session id: cron:clickhouse-review-slot-9:20260803-221800

@clickhouse-gh

clickhouse-gh Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 2e7e50b49 with master bb113c384 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of d469feea5; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

8 translation units recompiled, 21 s compile time in total, 8 of them have a recent master baseline.

Job report

@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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.

@groeneai

Copy link
Copy Markdown
Collaborator Author

New occurrence of the logical error this PR fixes, on #119846 at 8ed22a03 (AST fuzzer (amd_debug, targeted, old_compatibility)): a fuzzed UNION ALL of two RIGHT JOIN arms inside viewExplain, each arm setting parallel_replicas_for_non_replicated_merge_tree = 0 while the enclosing query has it at 1. Investigation and the check below: #119846 (comment)

Measured today on master 95448e95a, same tree and build dir: pristine master aborts at findParallelReplicasQuery.cpp:639, and master plus the two source files from this PR plans the query with no offload and no error. So this shape is covered by the change as it stands, and merged #113515 does not cover it.

@groeneai

Copy link
Copy Markdown
Collaborator Author

New occurrence of the logical error this PR fixes, AST fuzzer (amd_debug, targeted) on #120908 at 074a78e6: a fuzzed INTERSECT ALL inside viewExplain, each branch carrying SETTINGS parallel_replicas_for_non_replicated_merge_tree = 0. Same STID 3634-4123, 17 PRs in the last 30 days and 0 on master.

Measured on master 8467884689659 with and without the two source files in this PR: without them the shape aborts with Can't determine table for parallel replicas, with them it returns the right answer, and a control without the per-branch SETTINGS clause keeps its 2 ReadFromRemoteParallelReplicas steps in both builds. Neither a view nor EXPLAIN is needed to hit it, a plain set operation with a per-branch clause is enough, so this half of the fix is reachable from an ordinary query. Repro and the full before/after: #120908 (comment)

@clickhouse-gh

clickhouse-gh Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

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.

@alexey-milovidov alexey-milovidov 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.

Looks good!

@alexey-milovidov alexey-milovidov self-assigned this Oct 10, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 10, 2026
Merged via the queue into ClickHouse:master with commit 5fbccc9 Oct 11, 2026
175 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 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-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). 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 pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants