Skip to content

Do not resolve parallel-replicas callbacks from the context when cloning a read - #114022

Merged
nickitat merged 8 commits into
ClickHouse:masterfrom
groeneai:pr-clone-marked-parallel-read-callbacks
Sep 4, 2026
Merged

nickitat merged 8 commits into
ClickHouse:masterfrom
groeneai:pr-clone-marked-parallel-read-callbacks

Conversation

@groeneai

@groeneai groeneai commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

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: Next task callback is not set for query with id exception when parallel_replicas_plan_based is enabled and the query reads a system log table.

Description

Related: #111677, #116087

With parallel_replicas_plan_based = 1, a query over a system log table fails on the initiator:

SELECT count() FROM system.user_query_log
SETTINGS enable_parallel_replicas = 1, max_parallel_replicas = 3, parallel_replicas_plan_based = 1,
         parallel_replicas_for_non_replicated_merge_tree = 1, parallel_replicas_local_plan = 1,
         cluster_for_parallel_replicas = 'test_cluster_one_shard_three_replicas_localhost';
-- Logical error: 'Next task callback is not set for query with id: ...'

An exception, handled normally in a release build, but it aborts debug and sanitizer builds.

Root cause. applyParallelReplicas marks the coordinated read with
enableParallelReadingFromReplicasForSerialization, which deliberately attaches no callbacks: the step is
only serialized and shipped to replicas, where deserialize resolves them from the context.
createParallelReplicasPlan then clones that fragment once more for the initiator's local arm, and the
constructor cannot tell "marked for serialization" from "replica side, resolve from the context", so it took
its context fallback, which on an initiator has no coordinator callback. Ordinary plan-based queries survive
because Context's copy constructor carries the callbacks TCPHandler installed; the failing shape reads
under a context built fresh from the global context, which never holds them.

Fix. The constructor now stores exactly the parallel-reading state it is given, and the context
resolution moved into MergeTreeDataSelectExecutor::readFromParts. That is the single seam both
context-resolving callers pass through (deserialize on a replica, StorageMergeTree::read and
StorageReplicatedMergeTree::readLocalImpl on a follower) and the only place where "no extension was
passed" means "take them from the context". clone is back to master's form.

Validation. New test 04830_pr_plan_based_clone_marked_read aborts the server on master and is green
50/50 here. Both hunks are load-bearing over 30 runs each: restoring the constructor fallback aborts the
server with the original message; dropping the readFromParts resolution fails the follower arm with
bad_optional_access. It still reproduces on current master, so neither #112849 (since merged) nor #113788
covers it. It does not close #111677, whose report is broader.


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

Version info

  • Backported to: 26.8.5.15

…ing a read

With parallel_replicas_plan_based = 1, a query over a system log table or a
SQL SECURITY DEFINER view failed on the initiator with

    LOGICAL_ERROR: Next task callback is not set for query with id: <uuid>

applyParallelReplicas marks the coordinated read with
enableParallelReadingFromReplicasForSerialization, which deliberately attaches
no callbacks: the step is only serialized and shipped to replicas, where
deserialize rebuilds it and resolves the callbacks from the context.
createParallelReplicasPlan then clones that fragment once more to build the
initiator's local arm, and ReadFromMergeTree::clone() passed the
marked-but-callback-less state back through the constructor. The constructor
cannot distinguish "marked for serialization" from "replica side, resolve from
the context", so it took its context fallback, and an initiator holds no
coordinator callback.

Ordinary plan-based queries survive that fallback only because Context's copy
constructor carries the callbacks TCPHandler installed. Instrumenting the
constructor showed the fallback is taken on the ordinary path too, and merely
happens to find a callback there. The failing shapes read under a context built
fresh from the global context, which never holds them: a system log storage, or
a DEFINER view.

clone() now copies the flag and both callback optionals directly, so a copy no
longer re-derives state from the context. All three fields move together:
restoring only the flag would drop the callbacks of a marked read that has them,
which getParallelReadingExtension asserts on. The constructor's context fallback
is unchanged, since deserialize, StorageMergeTree::read and
StorageReplicatedMergeTree::readLocalImpl rely on it on a follower.

Both branches of that fallback were reachable with the same state: with the
first one made non-throwing, the same query threw the sibling message from
Context::getMergeTreeReadTaskCallback, so copying both optionals is required.

Still reproduced with both in-flight Merge route fixes applied (ClickHouse#112849,
ClickHouse#113788), so this is a separate defect rather than one of those routes.

Related: ClickHouse#111677
Review round 1 raised two majors about the test and the public claims, plus one
comment-budget nit. The C++ fix itself is unchanged.

Engagement oracle for the affected shape. The three affected-shape queries
asserted results only, so a regression making plan-based parallel replicas
silently decline for the system log shape would have left every oracle green
(count() > 0 is still 1 when the read is served locally). The affected query now
carries a unique log_comment and is followed by an assertion that
ParallelReplicasQueryCount > 0 for its own initiator row, following the pattern
of 02950 and 02875. The assertion was proven mutation-sensitive: it reddens 3/3
under each of enable_parallel_replicas = 0,
parallel_replicas_for_non_replicated_merge_tree = 0, max_parallel_replicas = 1
and automatic_parallel_replicas_mode = 2.

Note it witnesses that parallel replicas engaged, not that the plan-based path
specifically engaged. The counter is incremented in
ParallelReplicasReadingCoordinator's destructor, which also runs for ordinary
task-based parallel replicas, and the tree exposes no plan-based-specific
observable: there is no such ProfileEvent, and EXPLAIN prints an identical plan
for this shape whether plan-based is on or off, because the split happens below
the printed plan. A stricter oracle keyed on the replicas shipping a serialized
plan fragment was measured and rejected: it discriminated correctly by hand but
failed 4 of 20 runs under the test runner, because the number of participating
replicas and the log table's part layout vary per run.

Dropped the SQL SECURITY DEFINER view arm and its public claim. The arm never
reddened. StorageInMemoryMetadata::getSQLSecurityOverriddenContext starts the
DEFINER branch from the global context but then propagates both parallel-replicas
callbacks, gated on canUseTaskBasedParallelReplicas() and
hasMergeTreeAllRangesCallback(), both of which hold on an initiator under this
test's settings, so the pre-fix constructor fallback succeeds there. That is the
asymmetry with ReadFromUserQueryLog::initializePipeline, which propagates the
progress callback, the ProcessList element and the normalized query hash but not
the callbacks. Confirmed on the pristine-master binary with the view query run in
isolation, including with parallel_replicas_allow_view_over_mergetree = 1: it
passes in every arm. The changelog entry and description no longer name it as a
carrier, and the no-replicated-database tag went with the view, which was the
only access-entity object in the file.

Trimmed the comment block to the local invariant. The clause about the initiator
context was motivation rather than something the next reader needs at that spot,
so it lives here instead.

Revalidated: the amended test still aborts a pristine-master server with the
exact message and the expected frames (clone present, deserialize absent), and
passes 50/50 randomized plus 50/50 with plan-based and local-plan forced.
The engagement assertion added in the previous round checks
ParallelReplicasQueryCount, which is incremented in the reading
coordinator's destructor. The coordinator is constructed in
createParallelReplicasPlan before the arm choice, and the remote-only
branch reuses it, so that counter fires on both arms. It therefore
proves a coordinator existed, not that the initiator-local fragment was
built, and it is the local fragment that reaches the clone this change
repairs.

The snapshot replica is pinned only on the local arm
(setSnapshotReplicaNum has exactly two callers, both local-arm-only), so
its DEBUG line in system.text_log, scoped by query_id to the affected
query, witnesses that arm specifically. A regression routing this shape
to the remote-only arm would stop exercising the clone while results and
the existing counter stayed green.

Measured: query_id attribution is exact (one pin line in the window, zero
unattributed, sharing the initiator's own query_id). The assertion
reddens 3/3 under each of parallel_replicas_local_plan = 0 and
parallel_replicas_prefer_local_replica = 0 applied to the affected query
alone, while ParallelReplicasQueryCount stays green in both, and it is
stable over 50 randomized and 50 forced runs.
@groeneai

groeneai commented Aug 9, 2026

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

Three review rounds by a second model, independent of the author, plus my own cold read of the
resulting tree before seeing the author's evidence. Final round: 0 findings.

# Finding Verdict
❌ The engagement assertion could not witness the arm holding the fixed code. Raised twice (rounds 1 and 2), so it was fixed rather than argued away. ParallelReplicasQueryCount is incremented in ~ParallelReplicasReadingCoordinator, and the coordinator is built before the local-vs-remote arm choice and reused by both arms, so the counter is satisfied either way. Only the initiator-local arm reaches the cloned read this change fixes. AGREE - fixed. The test now also asserts the snapshot-replica pin in system.text_log, scoped by query_id to the affected query. That line is emitted from exactly two call sites, and the two are mutually exclusive by parallel_replicas_plan_based, so under the test's pinned settings the only reachable one sits two lines above the fixed clone call. Reddens 3/3 under each of parallel_replicas_local_plan = 0 and parallel_replicas_prefer_local_replica = 0 while the old counter stays green.
⚠️ The SQL SECURITY DEFINER view was named as a carrier in the changelog entry but was never exercised. The debug server aborted on an earlier statement, so that arm never ran. AGREE - fixed. getSQLSecurityOverriddenContext propagates both callbacks into the DEFINER context, so the pre-fix fallback succeeds there and the shape is not a carrier; confirmed empirically in three arms on the master binary. The claim was struck from the changelog entry and the description, and the arm dropped. The one CI occurrence that looks like a DEFINER carrier is AST-fuzzer-only, where the fuzz context pins allow_experimental_parallel_reading_from_replicas = 0.
💡 Justification comments in the diff were trimmed to the local invariant; motivation moved to the commit message. AGREE - fixed.
💡 The Related: line, the /*enable_parallel_reading=*/ argument spelling, and exposing system.user_query_log in a stateless test were each questioned. DISAGREE, with evidence: the upstream template's full-URL instruction governs the leading comment block, which this body satisfies verbatim; the argument-annotation spelling matches three pre-existing call sites in the same file; and three in-tree tests already read that table.

Two further notes I checked in source and did not raise: the assertion needs no no-parallel tag
because it is query_id-scoped rather than matching on logger_name alone, and SYSTEM FLUSH LOGS text_log drains that log's asynchronous queue synchronously, so the read cannot race the writer.

Stated plainly rather than left implicit: the new assertion is never reached on master, because the
abort happens several statements earlier. The master arm proves the fixed path is reached; the two
mutation arms on the fixed binary prove the assertion is live. One input class is not constructible on
this tree - a clone of a marked read that already carries callbacks - measured as 0 of 69 clones across
the plan-based suite, and left covered by the existing assertion in getParallelReadingExtension.

Session id: cron:clickhouse-review-slot-11:20260809-082700

@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, 100% on demand, one query: SYSTEM FLUSH LOGS query_log; SELECT count() > 0 FROM system.user_query_log with parallel_replicas_plan_based = 1 and parallel_replicas_local_plan = 1 on a 3-replica cluster. Both settings are load-bearing (the throwing clone sits inside canUseLocalPlanForParallelReplicas), as is the flush: an empty log has no parts, so the read is replaced with ReadFromPreparedSource and never reaches the clone.
b Root cause explained? Yes. applyParallelReplicas marks the coordinated read with enableParallelReadingFromReplicasForSerialization, which attaches no callbacks by contract. createParallelReplicasPlan then clones the fragment again for the initiator's local arm, and ReadFromMergeTree::clone() passed that marked-but-callback-less state back through the constructor, which cannot distinguish it from the replica-side case and so took its context fallback. An initiator holds no coordinator callback, so Context::getMergeTreeAllRangesCallback threw.
c Fix matches root cause? Yes. clone() copies the flag and both callback optionals directly, so a copy no longer re-derives state from the context. Not a widened bound, not a no-random-* tag, not a defensive guard at the throw site: the invariant "a parallel-reading step has callbacks" stays asserted, and the constructor's context fallback is unchanged for its legitimate follower-side users.
d Test intent preserved / new tests added? Yes. No existing test changed or weakened. New 04830_pr_plan_based_clone_marked_read covers both carrier shapes (system log and merge()-wrapped), result equality against non-parallel execution, a GROUP BY guard against the "each replica reads everything" bug, the coordinator failpoint path, an anti-vacuity EXPLAIN assertion proving the read is still distributed, and an engagement assertion on the affected shape itself (ParallelReplicasQueryCount > 0, scoped by log_comment) so a regression that made it decline parallel replicas cannot leave count() > 0 green. That assertion was proven mutation-sensitive: it reddens 3/3 under each of four engagement-removing mutations (enable_parallel_replicas = 0, parallel_replicas_for_non_replicated_merge_tree = 0, max_parallel_replicas = 1, automatic_parallel_replicas_mode = 2). A second assertion narrows that to the arm which actually holds the clone under test: the snapshot replica is pinned only when the initiator-local fragment is built, so a system.text_log check for that pin, scoped by query_id to the affected query, witnesses the local arm specifically. It is mutation-sensitive too, reddening 3/3 under each of parallel_replicas_local_plan = 0 and parallel_replicas_prefer_local_replica = 0 on the affected query alone, both of which route the shape to the remote-only arm while leaving ParallelReplicasQueryCount > 0 green.
e Both directions demonstrated? Yes, on Build-ID-verified binaries (master a319dcc3, fix 397cec09), asserting the FULL exception message rather than the error code. Repro throws and aborts the server on master, passes on the fix; the new test kills the server on master (SIGABRT) and is OK on the fix; the parallel_replicas_plan_based = 0 negative control passes on master. Master-side frame controls: ReadFromMergeTree::clone present, ReadFromMergeTree::deserialize absent.
f Fix is general across code paths? Yes, enumerated mechanically rather than by eye. A tree-wide scan for the "argument absent, resolve from context" constructor pattern finds exactly 2 sites, both in this constructor, both bypassed by the copy. Parsing every *::clone() const body under src/Processors/QueryPlan/ finds 0 that read the context, so no sibling step carries the same latent defect. All plan-clone callers funnel through QueryPlan.cpp:1195, so createParallelReplicasPlan, buildPlanFragment and materializeQueryPlanReferences are covered by one change instead of a per-call-site guard. Both callback halves are covered symmetrically, and I confirmed the second half is genuinely live: with the first fallback made non-throwing, the same repro threw the sibling message from getMergeTreeReadTaskCallback.
g Fix generalizes across inputs (params/datatypes/wrappers)? Partial, and stated rather than claimed. Type wrappers do not apply: the change copies three struct fields and reads no data. Both callback halves and both carrier shapes are covered. The remaining input class, a clone of a marked read that does carry callbacks, does not exist on this tree: instrumenting clone() across the 31-test plan-based suite recorded 69 clones of a marked read, 0 with either callback present, because the only producer of a callback-bearing marked read replaces the node at the end of plan construction and nothing clones the plan afterwards. So the flag-only variant cannot be reddened by any SQL-level arm. It stays covered by the existing chassert in getParallelReadingExtension, which fires in any debug or sanitizer build if a future caller ever clones such a step.
h Backward compatible? (maintainer-approved exception only) Yes. No setting is added or given a new default, so no SettingsChangesHistory.cpp entry is needed. No serialization or on-disk format change: clone() is in-process, and the replica-side deserialize path is untouched, so mixed-version clusters are unaffected. Behaviour changes only for a state that previously threw.
i Invariants and contracts preserved? Yes. The invariant is that a ReadFromMergeTree in parallel-reading mode either holds both callbacks or is a serialization-only step that must never resolve them from the context, and a clone reproduces that state exactly. All three fields are copied together, so the flag and the two optionals cannot desynchronize; clearParallelReadingExtension, which clears all three at once, stays consistent; the chassert(all_ranges_callback.has_value() && read_task_callback.has_value()) in getParallelReadingExtension remains valid; number_of_current_replica still passes through the constructor unchanged; and the four legitimate users of the retained context fallback (deserialize, StorageMergeTree::read, StorageReplicatedMergeTree::readLocalImpl via MergeTreeDataSelectExecutor) are untouched, with a positive-control arm for that path in the new test.

Session id: cron:clickhouse-impl-slot-5:20260809-050700

@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

cc @KochetovNicolai @vdimir, could you review this? With parallel_replicas_plan_based, the split marks a coordinated read for serialization with no callbacks attached by contract, but the extra ReadFromMergeTree::clone() that builds the initiator local arm passed that state back through the constructor, which cannot tell it from the replica side and so resolved a callback from the context, where an initiator has none. The clone now copies the flag and both callback optionals directly.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Aug 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [cfff54b]

Summary: ✅


AI Review

Summary

This PR fixes the plan-based parallel-replicas clone path so a ReadFromMergeTree step preserves the exact callback state it was given, and moves context-based callback resolution to MergeTreeDataSelectExecutor::readFromParts for the paths that actually execute the read. The new stateless test covers the system-log carrier that reproduced the exception, checks that the initiator-local arm is really built, and guards against silent replica-side failures. I did not find any remaining correctness or coverage gaps in the current diff.

Final Verdict

Status: ✅ Approve

LLVM Coverage Report

Measured on commit cfff54b.

Metric Baseline Current Δ
Lines 88.70% 88.70% +0.00%
Functions 92.10% 92.10% +0.00%
Branches 81.00% 81.00% +0.00%

Changed lines: Changed C/C++ lines covered: 29/29 (100.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Aug 9, 2026
@groeneai

groeneai commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — ffcc3e1

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 (arm_binary, parallel) / 04357_distributed_alias_same_expression pre-existing flaky, not caused by this PR (124 rows / 110 unrelated PRs / 10 master hits in 30d) #108855 (mine, open)
Stress test (arm_tsan) / Logical error: Sizes of nested column and null map of Nullable column are not equal after deserialization (STID 6726-6874) pre-existing trunk bug (54 rows / 47 unrelated PRs / 3 master hits, first seen 2026-07-13) #112484 (mine, open) and #106988 (mine, open)
Sync - CH Inc sync (private, not actionable by me)

Session id: cron:our-pr-ci-monitor:20260809-220000

Refresh the branch against master d466df7 so it is ready
to review. The two CI failures the finish ledger owned have since been fixed on master
(ClickHouse#108855 and ClickHouse#112484), which is what was blocking Mergeable Check.

No conflict: the clone() triple copy still applies verbatim and master's newer restores in
the same function are preserved.
Comment-only: stripping comment lines from both revisions gives byte-identical SQL. The two
comments keep their substance (why parallel_replicas_local_plan is required for the second
clone, and why the log flush is required for the read to reach it) and say it plainly.
@clickhouse-gh

clickhouse-gh Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing cfff54bb2 with master 752470550 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of f16484443; 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, 42 s compile time in total, 8 of them have a recent master baseline.

Job report

@groeneai

groeneai commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - bc194a3

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
Bugfix validation (functional tests, amd64) harness abort, not a bug-reproduction result: assert build_urls, "Could not find master builds in S3" at ci/jobs/functional_tests.py:734. Trunk-wide, 94 distinct PRs / 228 rows in 24 h against 3 PRs passing #117433 (mine, open)
Bugfix validation (functional tests, aarch64) same harness abort, same line #117433 (mine, open)
Finish Workflow / new_tests_check.py consequence of the two rows above: the hook reads their ERROR and reports that no per-arch job validated the bug. No independent defect #117433 (mine, open)
Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) / Container memory budget exceeded (/docker) container leak, not capacity. This job already carries #117412 (its own log reports CI_DIND_INIT_RESERVE=8589934592, the flat 8 GiB that PR introduced) and the leaf still breached, so #117412 is present and insufficient here. The failing shard's log names test_refreshable_mat_view 214 times and test_refreshable_mat_view_replicated 61 times, which are 2 of the 3 session-scoped fixtures whose clusters stay resident for the whole job #117564 (mine, open)

No failure here is caused by this PR's diff: the two bugfix arms and the Finish Workflow row are
one trunk-wide harness abort, and the integration row is a fixture-lifetime leak in tests this PR
does not touch.

Session id: cron:our-pr-ci-monitor:20260901-203000

The constructor read `enable_parallel_reading` as "this read must have coordinator
callbacks" and resolved from the query context any callback it was not given. That
conflates two callers: one that has no callbacks and wants them resolved (a read a
replica rebuilds from a serialized plan, and a follower read), and one whose callbacks
are genuinely absent because the read is executed on the replicas rather than here.
`enableParallelReadingFromReplicasForSerialization` marks a read of the second kind, so
cloning such a read asked the context for a callback an initiator does not hold and got
`Next task callback is not set for query with id`.

The constructor now stores exactly the state it is given, and the resolution moved to
`MergeTreeDataSelectExecutor::readFromParts`, which is the single seam both
context-resolving callers pass through and where "no extension was passed" really does
mean "take them from the context". `clone` is back to passing its own three fields, so
the assignments that followed the constructor call are gone.

The test also asserts that no query in its database ended in an exception. A
replica-side arm of a coordinated read runs under its own query id and can fail without
changing the rows the initiator returns, so the result comparisons alone did not cover
the `readFromParts` half of this change.
…eptions

Two gaps in the previous revision of this test, both about the fallback that moved into
`MergeTreeDataSelectExecutor::readFromParts`.

The non-plan-based control kept `parallel_replicas_local_plan = 1`, so the initiator had a
local arm that could produce the whole result while the unused remote sources were
cancelled: the row counts could match without any follower having resolved a callback.
Setting `parallel_replicas_local_plan = 0` removes the local arm, so the result can only
come from followers.

The callback lookup happens while the plan is built, before the query is logged as started,
so a missing one is recorded as `ExceptionBeforeStart`, which the oracle did not count.

Measured over 30 runs each: unchanged 30/30 green with the fix; reverting only the
`readFromParts` hunk now fails on the first runs instead of 23 of 30.
…path

`SELECT count() > 0 FROM merge('system', '^user_query_log$')` was in the test as a second
carrier shape, but a `Merge` table never gets a parallel-replicas child plan:
`getChildPlanOptimizationSettings` clears `enable_parallel_replicas` in the child
optimization settings and `ReadFromMerge::createPlanForTable` clears it in the child
context as well. Neither is conditional, so no setting turns it back on.

Measured on this tree with the two oracles the test already uses, scoped per query by
`log_comment`. The direct `system.user_query_log` read reports
`ParallelReplicasQueryCount = 1` and one `ParallelReplicasReadingCoordinator` snapshot-replica
line; an ordinary MergeTree read reports the same; the `merge()`-wrapped read reports 0 and
has no coordinator line at all. On a binary with the constructor fallback restored, the
`merge()` query alone passes with no throw, while the direct read alone aborts the server
with `Next task callback is not set for query with id` and the recorded frames.

So the line could not fail whatever this change did to the constructor, and the claim that
the test covered two carrier shapes was wrong. The direct read is the shape that reproduces.
Unchanged 20/20 green with the fix, and still aborts the server with the fallback restored.
@clickhouse-gh clickhouse-gh Bot added the comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). label Sep 4, 2026
@nickitat
nickitat added this pull request to the merge queue Sep 4, 2026
Merged via the queue into ClickHouse:master with commit 6079427 Sep 4, 2026
175 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 4, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 15, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 15, 2026
clickhouse-gh Bot added a commit that referenced this pull request Sep 15, 2026
Backport #114022 to 26.8: Do not resolve parallel-replicas callbacks from the context when cloning a read
strtgbb pushed a commit to Altinity/ClickHouse that referenced this pull request Sep 16, 2026
…callbacks from the context when cloning a read
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-ci-master PR origin: master/nightly CI monitoring finding pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.8-must-backport

Projects

None yet

6 participants