Skip to content

Make ReadNothingStep serializable for distributed query plans - #111941

Merged
alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/read-nothing-step-serializable
Jul 27, 2026
Merged

alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/read-nothing-step-serializable

Conversation

@groeneai

@groeneai groeneai commented Jul 26, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Improvement

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

Support distributed query plans (make_distributed_plan) for queries whose source provably produces no rows at planning time, such as a read from an empty MergeTree table. Such queries previously failed with SUPPORT_IS_DISABLED.

Description

Related: #110234
Related: #110225

Follow-up to #110234, where @ alexey-milovidov asked for ReadNothingStep to be made serializable.

ReadNothingStep never overrode isSerializable(), so it inherited the conservative false default from IQueryPlanStep. Any plan fragment containing it was rejected before execution by assertFragmentSerializable:

Code: 344. DB::Exception: make_distributed_plan cannot distribute this query:
step 'ReadNothing' in stage 'stage_0' is not serializable for remote execution. (SUPPORT_IS_DISABLED)

The step is planted whenever a source provably yields no rows (PlannerJoinTree.cpp, InterpreterSelectQuery.cpp, StorageFromMergeTreeProjection.cpp, ReadFromMergeTree.cpp), so this was not specific to #110234: a distributed aggregation over an empty MergeTree table failed on master. That is the user-visible bite, and the regression test.

The step carries no state at all beyond its output header (its constructor takes only a SharedHeader; clone() just re-wraps getOutputHeader(); initializePipeline inits a NullSource). Since QueryPlan::serialize already writes each node's name, description, header and settings generically before calling step->serialize, the step's own payload is empty. So this wires it into the existing mechanism the same way ExtremesStep does, taking the header from ctx.output_header as source steps do (ReadFromTableStep::deserialize), plus the two-line QueryPlanStepRegistry entry.

I verified the registry entry is load-bearing rather than decorative: with serialize/deserialize in place but registerReadNothingStep omitted, the same query fails with Code: 47 UNKNOWN_IDENTIFIER: Unknown query plan step: ReadNothing from the receiving side, confirming the deserialize path really is exercised (the local executor in DistributedPlanExecutor does a full serialize/deserialize round trip).

No serialization version bump. The plan stream carries one leading version (DBMS_QUERY_PLAN_SERIALIZATION_VERSION, currently 3), and it does not need to gate a new step name, because the name registry is already self-describing and fail-closed: an older receiver looks the name up in QueryPlanStepRegistry::createStep, does not find it, and throws UNKNOWN_IDENTIFIER before reading any step body: no stream desync, no misparse, and the payload is empty so there is no field a mixed-version pair could disagree about. Downgrade path: an old receiver rejects cleanly, and the same query already failed before this change (earlier, on the initiator, with SUPPORT_IS_DISABLED), so a loud failure is replaced by a loud failure and nothing that worked stops working. Upgrade path: a new receiver understands the name. This matches every step name added so far (ReadFromTable, ObjectFilter, BuildRuntimeFilter, the Shuffle/Gather/Broadcast pairs), none of which touched ProtocolDefines.h; the two existing version constants both gate a payload bit inside an existing step in ReadFromMergeTree, which is precisely the case a name cannot express. Bumping the version instead would make an old receiver reject every plan from a newer initiator (and RemoteQueryExecutor disconnects replicas below a minimum plan version), which is a much larger blast radius than the gap being closed.

Scope. This PR only makes the step serializable. It deliberately does not remove the make_distributed_plan early return in the #110234 pass: a ReadNothing leaf changes what the distributed planner sees on that side (shard list, read-rows estimate, join strategy), which deserves its own PR. I did correct that guard's comment and 04512's prose, since both asserted the claim this PR falsifies.

Sibling coverage. Among the direct ISourceStep subclasses lacking isSerializable(), every other one holds state that cannot cross a process boundary: storage/mutations snapshots plus ContextPtr (LazilyReadFromMergeTree, LazilyUnorderedReadFromMergeTree, LazyReadReplacingFinalStep, ReadFromStorageLogStep), a live ChunkBufferPtr (ReadFromCommonBufferStep), a Pipe factory (ReadFromStreamLikeEngine), a QueryTreeNodePtr (ReadFromRecursiveCTEStep), a whole local QueryPlanPtr (ReadFromLocalParallelReplicaStep), a connection pool plus a reading coordinator (ReadFromParallelReplicasStep, ReadFromMySQLStep), a Pipe plus a StorageInput & (ReadFromInput), a MergeTreeData & plus a part snapshot (ReadFromPart), or a raw QueryPlan::Node * into the same plan (CommonSubplanReferenceStep). The SourceStepWithFilter subtree is per-storage read plumbing rather than a counterexample: its two wired-up members (ReadFromMergeTree, ReadFromObjectStorageStep) are already serializable, filter DAGs included (FilterDAGInfo::serialize, PrewhereInfo::serialize). One genuine sibling gap remains and I am not fixing it here: ReadFromSystemOneStep is equally stateless and hits the same error (step 'ReadFromSystemOne' ... is not serializable). It is deferred because system.one reached via ReadFromStorageStep is already special-cased as serializable (ReadFromPreparedSource.cpp), so only the dedicated step path is missing, and that step lives in clickhouse_storages_system, which is not linked to the query-plan module (see the existing workaround comment in Optimizations/optimizeJoin.cpp), so registering it needs a layering decision, not this one-line-of-state change. Happy to file that follow-up.

Header round-trip is safe for the compound and wrapped types the test covers (LowCardinality(Nullable(String)), Array, Map, Tuple, Nullable). Only names and types travel: deserializeHeader rebuilds each column via type->createColumn(), so the payload is type metadata and nothing else. The post-deserialize assertCompatibleHeader check cannot fail for this step, since it adopts ctx.output_header verbatim and the comparison is then between one and the same header object.

Version info

  • Merged into: 26.8.1.196 (included in 26.8 and later)
  • Backported to: 26.7.4.43, 26.6.3.47

ReadNothingStep never overrode isSerializable(), so it inherited the
conservative false default from IQueryPlanStep and was absent from
QueryPlanStepRegistry. assertFragmentSerializable therefore rejected any
multi-stage distributed plan fragment containing it:

  Code: 344. make_distributed_plan cannot distribute this query: step
  'ReadNothing' in stage 'stage_0' is not serializable for remote execution.

The step is planted whenever a source provably yields no rows (PlannerJoinTree,
InterpreterSelectQuery, StorageFromMergeTreeProjection, ReadFromMergeTree), so
this was not specific to the const-false JOIN short-circuit pass: a distributed
aggregation over an empty MergeTree table failed on master.

The step's entire state is its output header, which QueryPlan::serialize already
writes generically per node before calling step->serialize, so its own payload
is empty. Wire it into the existing mechanism following ExtremesStep, taking the
header from ctx.output_header as source steps do (ReadFromTableStep), plus the
registry entry.

No serialization version bump. The step-name registry is self-describing and
fail-closed: an older receiver throws UNKNOWN_IDENTIFIER before reading any step
body, and the payload is empty so no field can be misparsed. The same query
already failed loudly before this change, earlier on the initiator, so a loud
failure is replaced by a loud failure and nothing that worked stops working.
Every step name added so far landed without touching ProtocolDefines.h; the two
existing version constants gate a payload bit inside an existing step, which a
name cannot express. Bumping instead would make old receivers reject every plan
from a newer initiator, and RemoteQueryExecutor disconnects replicas below the
minimum plan version.

Scope is serialization only: the make_distributed_plan early return in
shortCircuitConstantFalseJoin stays, because a ReadNothing leaf changes what the
distributed planner sees on that side (shard list, read-rows estimate, join
strategy) and deserves its own change. Its comment and 04512's prose are
corrected, since both asserted the claim this commit falsifies.

One sibling gap is left deliberately: ReadFromSystemOneStep is equally stateless
and fails the same way, but system.one reached via ReadFromStorageStep is
already special-cased as serializable, and that step lives in
clickhouse_storages_system, which is not linked to the query-plan module, so
registering it is a layering decision.

Follow-up to ClickHouse#110234.
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (2 majors found and fixed, 3 nits)

Before opening this PR I ran an independent cold review of the resulting code plus two second-model
review passes, and adjudicated every finding against the recorded evidence. Both majors were in the
regression test, not the fix; both are fixed here.

# Severity Finding Verdict
❌ 1 major 04628 asserted only result values, so it passed unchanged with make_distributed_plan = 0. assertFragmentSerializable runs only on the multi-stage branch (QueryPlan.cpp:879), so a plan that stays single-stage is never serialized and the test would not notice losing coverage of this fix. AGREE, fixed: added an EXPLAIN PIPELINE oracle keyed on ReadFromDistributedPlanSource for both shapes, and verified the negative control - flipping only make_distributed_plan to 0 now makes the test FAIL.
❌ 2 major A test comment claimed the query put a Const column in ReadNothingStep's header. It does not: every planting site builds the header via getSampleBlockForColumns, which uses type->createColumn() (StorageSnapshot.cpp:126), and 42 AS c is a projection above the source. AGREE, fixed: removed the false claim, and the same stale claim in this PR's description. The concern is moot anyway, since serializeHeader transmits only names and types.
💡 3 nit -- Tags: no-old-analyzer carried no reason line, unlike sibling make_distributed_plan tests. AGREE, fixed.
💡 4 nit registerStep(&ReadNothingStep::deserialize) uses the address-of form where most siblings omit it. DISAGREE: both idioms are upstream (ReadFromTableStep.cpp:94 uses &), and they are identical after function-to-pointer decay.
💡 5 nit The Related: lines should use full GitHub URLs rather than #NNNNN shorthand. DISAGREE: both forms are in active use upstream, the shorthand renders as a live link (what matters is that provenance is visible in the rendered body, not only in the HTML comment), and the suggested replacement pointed /pull/110225 at what is actually an issue.

The oracle uses a non-aggregating SELECT '<label>' FROM (EXPLAIN PIPELINE ...) WHERE explain LIKE '%ReadFromDistributedPlanSource%' rather than the more common countIf(...) > 0 form, because this
test pins make_distributed_plan = 1 at session level: an aggregating oracle distributes itself and
dies with SUPPORT_IS_DISABLED on ReadFromStorage before it can measure anything. Pinning the
oracle's settings inline instead would decouple it from the session SET under test, so the
presence-of-row encoding is the form that stays sensitive to what the test asserts.

Checks that found nothing, recorded so the ground covered is visible: the empty payload is a
complete round trip (the header travels in the generic per-node preamble, Serialization.cpp:124
and :220); the post-deserialize assertCompatibleHeader cannot fail for this step because it
adopts ctx.output_header verbatim, making the comparison &lhs == &rhs (Block.cpp:145);
isSerializable() has exactly three consumers and flipping it to true is safe in all of them
(calculateHashTableCacheKeys.cpp:72 takes an ITransformingStep, which this is not, so no
hash-table cache key changes); no existing test encodes the old behaviour (04310 rejects a
different step and still passes); the ctx.skipping drain path in ReadFromMergeTree::deserialize
already builds a ReadNothingStep (:5642) and is unaffected; and the two comment corrections are
comment-only, with 04512's .reference byte-identical.

I also checked the one way "now proceeds" could be worse than "used to throw": a ReadNothing leaf
reports a single-element shard list (makeDistributed.cpp:848-861), and makeDistributedPlan
raises a logical error when two join children disagree on shard-list size (:939-941). In the plans
this change newly admits, the sibling side also resolves to one shard because
tryMakeDistributedRead bails on a small or empty table (:588), so no mismatch arises. That same
interaction is why this PR leaves the make_distributed_plan guard in the constant-false-join pass
in place.

The no-version-bump decision was re-derived independently rather than taken from the
implementation: both existing plan-version constants gate a payload bit inside
ReadFromMergeTree, which a step name structurally cannot express, and
NegativeLimitStep.cpp:73-90 is the in-tree precedent for deliberately not bumping when the stream
is self-describing.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, not a flake but a hard planner rejection. make_distributed_plan = 1 + distributed_plan_execute_locally = 1 over an empty MergeTree table: SELECT sum(x) FROM t, SELECT count() FROM t, GROUP BY, and empty-UNION ALL-populated all fail 100% of runs on master with Code: 344 SUPPORT_IS_DISABLED: step 'ReadNothing' in stage 'stage_0' is not serializable for remote execution. Control: a non-aggregating SELECT * FROM t passes, because assertFragmentSerializable only runs when the plan has more than one stage.
b Root cause explained? ReadNothingStep never overrode isSerializable(), so it inherited false from IQueryPlanStep, and it was absent from QueryPlanStepRegistry. assertFragmentSerializable rejects any multi-stage fragment containing a non-serializable step. The step's entire state is its output header, which QueryPlan::serialize already writes generically per node, so its own payload is empty. It was simply never wired into the mechanism.
c Fix matches root cause? Yes. The missing capability is supplied at the step itself (isSerializable + serialize + static deserialize + registry entry), copying ExtremesStep and taking the header from ctx.output_header as source steps do. assertFragmentSerializable is untouched, so genuinely non-serializable steps are still rejected. No suppressed check, no widened bound, no guard at the throw site.
d Test intent preserved / new tests added? New stateless SQL test 04628_read_nothing_step_serializable (SQL rather than a C++ gtest; parallel-safe, no no-parallel tag; reference generated from a real run). It also asserts the plan really distributes, via ReadFromDistributedPlanSource in an EXPLAIN PIPELINE subquery, so the coverage cannot silently erode into a single-stage plan that never serializes anything: flipping make_distributed_plan off makes the test fail rather than pass vacuously. 04512 is changed in comments only, with its queries, expectations and .reference untouched. 04310_distributed_unserializable_step_rejected, which asserts a different step is still correctly rejected, keeps passing and guards against this change weakening the check.
e Both directions demonstrated? Yes. 04628 FAILS on pristine master (Build ID 3ed2cb74) with the exact Code: 344 above, and PASSES with the fix (Build ID 8f0ec2d3); in every run the server's buildId() was asserted equal to the binary's. Additional negative control: keeping serialize/deserialize but deleting the registry call yields Code: 47 UNKNOWN_IDENTIFIER: Unknown query plan step: ReadNothing, proving the deserialize path is really exercised rather than only a boolean flag being read.
f Fix is general across code paths? All 21 ISourceStep subclasses were enumerated. Every other one lacking isSerializable() provably holds state that cannot cross a process boundary (storage/mutations snapshots plus ContextPtr, a live ChunkBufferPtr, a Pipe factory, a QueryTreeNodePtr, a whole local QueryPlanPtr, connection pools and a coordinator, filter DAGs, or a raw in-plan Node *). One genuine sibling gap is disclosed and deliberately deferred: ReadFromSystemOneStep is equally stateless and fails identically, but system.one via ReadFromStorageStep is already special-cased as serializable and that step lives in clickhouse_storages_system, which is not linked to the query-plan module, so registering it is a layering decision and a separate concern. Also checked: the ReadFromMergeTree::deserialize ctx.skipping placeholder that already builds a ReadNothingStep is unaffected (built, never re-serialized), and the gtest subset registry needs no entry.
g Fix generalizes across inputs (params/datatypes/wrappers)? The output header is the step's whole state, so the test exercises LowCardinality(Nullable(String)), Array(UInt64), Map(String, Nullable(Int32)), Tuple(a UInt8, b String) and Nullable(Float64), plus a projection above an empty source. Constness is not a boundary here, and I checked rather than assumed: serializeHeader writes only column names and types, and every planting site builds the header through StorageSnapshot::getSampleBlockForColumns, which inserts type->createColumn() and so never yields a ColumnConst. Row-count boundaries are degenerate by construction, since the step always produces zero rows.
h Backward compatible? (maintainer-approved exception only) Yes, and no version bump, argued rather than assumed. No setting is added or default changed, so no SettingsChangesHistory.cpp entry is due. The plan stream's leading version does not need to gate a new step name: the name registry is self-describing and fail-closed, so an older receiver throws UNKNOWN_IDENTIFIER before reading any step body (shown empirically above), the payload is empty so no field can be misparsed, and the same query already failed loudly before this change, earlier on the initiator. Loud failure replaces loud failure and nothing that worked stops working. Every step name added so far landed without touching ProtocolDefines.h; the two existing version constants gate a payload bit inside ReadFromMergeTree, which a name cannot express. Bumping instead would make an old receiver reject every plan from a newer initiator, and RemoteQueryExecutor disconnects replicas below the minimum plan version, so that is a strictly larger blast radius.
i Invariants and contracts preserved? serialize writes zero bytes and deserialize reads zero bytes, so the stream stays exactly balanced, which is the only way this class of change could desync it. The registry name equals getName(), and registerStep throws LOGICAL_ERROR on a duplicate, so a collision would fail loudly at startup rather than silently. clone() and updateOutputHeader() are unchanged and already correct, and serializeSettings has nothing to persist. isSerializable() is consulted only by assertFragmentSerializable and by calculateHashFromStep(const ITransformingStep &); the latter takes an ITransformingStep while this is an ISourceStep, so hash-table cache keys are unaffected. No new allocation, lock, resource or error path, and nothing touching durability or crash restart, since this is planning-time only.

Verification: 04628 fails on master and passes with the fix, both with the server's buildId() asserted against the binary's Build ID. 50 randomized runs of 04628 gave 50/50 passes, and a second 50-run pass with --order=random over 04628 plus 04512 gave 100/100, for 150 passes and 0 failures. All 74 tests in the distributed-plan and serialize_query_plan neighbourhood were run differentially on master and on the fixed binary with identical error counts; the only per-test changes are 04628 going from failing to passing and one pre-existing sandbox flake (04227_pr_materialized_cte_set_subquery, which fails 4 of 12 runs on pristine master versus 1 of 6 with the fix, with a stack entirely inside ParallelReplicasReadingCoordinator).

Session id: cron:clickhouse-impl-slot-4:20260726-063400

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @KochetovNicolai @CurtizJ - could you review this? It wires ReadNothingStep into the query-plan step serialization mechanism (isSerializable plus an empty-payload serialize/deserialize and a registry entry, following ExtremesStep), so a make_distributed_plan query whose source provably yields no rows, such as an aggregation over an empty MergeTree table, no longer fails with SUPPORT_IS_DISABLED. The description argues why no plan-serialization version bump is needed.

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

clickhouse-gh Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8d4183b]

Summary: ✅


AI Review

Summary

This PR wires ReadNothingStep into query-plan serialization so make_distributed_plan can carry fragments whose source is known-empty at planning time instead of rejecting them up front. I traced the new isSerializable/serialize/deserialize path, the registry hookup, the distributed-plan fragment round trip, and the added regression coverage, and I did not find a correctness or compatibility issue in the current code.

Final Verdict

✅ No findings.

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jul 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 21648ca

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_tsan, parallel) / 04546_constant_join_shrink_stored_blocks flaky (13 unrelated PRs + 2 master in 30d; the job's own randomized rerun passed 15/15) #111921 (mine, merged 2026-07-26T14:19:28Z) - the failing build predated it, so I merged master @ 3e1c729 to pick it up
Stateless tests (amd_llvm_coverage, old analyzer, s3 storage, DBReplicated, WasmEdge, parallel, 2/3) / Server died + Logical error '!part.empty()' server abort. The !part.empty() label is a log-check artifact: that string occurs exactly once in the 17 MB clickhouse-server.err.log, inside an SQL comment of a passing test. The Received signal Aborted (6) line names the real abort - Logical error: 'Arguments of 'multiply' have incorrect data types: 'n' of type 'Int256', '0.123' of type 'Float64'' on query SELECT n * 0.123 FROM (SELECT * FROM tbl_03007_1) under 03915_exchange_tables_race.sh. "Server died" is the same event. #109747 (mine, open) - it fixes exactly this abort (skip constant folding in executeActionForPartialResult when an argument type has drifted after a concurrent EXCHANGE TABLES) and carries 03915_exchange_tables_race.sh
Stress test (arm_debug) / Logical error: Inconsistent KeyCondition behavior (STID 5182-2f27) KeyCondition monotonic-chain canary (#111421 family) #109023 (mine, open)
Stress test (arm_release) / Not-ready Set is passed as the second argument for function 'globalNotIn' (STID 0250-3e49) #107619 family, buildOrderedSetInplace leaves the set unbuilt; 17 hits / 17 distinct PRs / 0 master in 30d #102192 (external, open)
AST fuzzer (amd_debug, targeted) / Block structure mismatch in deserialization of query plan MergingAggregated step stream (STID 0993-290c) trunk 0993 family: an anyRespectNullsOrNullStateOrNullDistinctTuple column arrives as Tuple(AggregateFunction(...)) on one side and Tuple(Nullable(Nothing)) on the other. 10 hits / 8 unrelated PRs + 1 master in 40d, first seen 2026-07-12 a fix task is created (investigating at full effort - fixing-PR link to follow here)

None is caused by this PR. Config Workflow, Fast test (amd + arm_darwin) and Style check are green; Bugfix validation is skipped (pr-improvement). On the last line I want to be explicit rather than lean on the family: this PR does touch plan-step serialization, so I checked it directly - the mismatch is an aggregate-state vs Nullable(Nothing) divergence in MergingAggregated, the signature predates this branch by two weeks on unrelated PRs and master, and #110930 (the earlier -Tuple + RESPECT NULLS fix for this shape) is already an ancestor of this head, so it failed with that fix present and needs its own root cause. ReadNothingStep is not in the stack.

Fresh CI is now running on 3e1c729 (the master merge).

Session id: cron:our-pr-ci-monitor:20260726-183000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the AST fuzzer (amd_debug, targeted) STID 0993-290c MergingAggregated deserialization header mismatch: #111570 (merged 2026-07-26T20:18:43Z, 84d39eb455b7bde002687df5d9e1a8240906c00a).

The failing build (21648ca) predated that merge. Same root cause as the fix describes: the -Tuple combinator named its shared state via getAssociatedNameByNullsAction, whose respect_nulls/ignore_nulls maps hold base aggregate names only, so with a nested combinator chain under -Tuple (here anyRespectNullsOrNullStateOrNullDistinct) the shared name stayed unadjusted while getImpl applied the nulls action at the base of the chain when instantiating the elements. The persisted state-type name then identified a different function than the elements held, and re-resolving it on the shard reconstructed a mismatched function.

Verified locally rather than assumed, since the fix's own reproducer uses a shorter chain than this failure. Driving the exact aggregate expression from the abort (recovered from server.log by query id, not the CIDB Failed query field) through a two-shard loopback server with serialize_query_plan = 1 and process_query_plan_packet enabled:

So #111570 is causally the fix for this signature. No further PR needed from my side, and no test added: #111570 already ships 04638_tuple_combinator_nested_suffix_nulls_action.sql covering the distributed state-name round-trip.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 3e1c729

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 (amd_llvm_coverage, old analyzer, s3, DBReplicated, WasmEdge, parallel, 2/3) / 04627_analyzer_compatibility_final_all_joined_tables deterministic (3/3 reruns), missing enable_analyzer pin on a newly merged test, hits master and every PR running this check #111991 (external, merged 2026-07-26T23:38:49Z) - merged master to pick it up @ 8d4183b
Stateless (amd_llvm_coverage, ParallelReplicas, s3, parallel) / Got read request from replica N for unknown stream (STID 5217-5b3d), plus the Server died and Logical error '!part.empty()' lines on the same job one abort, three labels. The !part.empty() label is a log-scraper artifact: that string occurs only inside an SQL comment of a passing test, while the Received signal record names ParallelReplicasReadingCoordinator.cpp:1295 <- RemoteQueryExecutor.cpp:870. Server died is the same abort taking the coverage-build server down #111689 (ours, open)
Stateless (amd_llvm_coverage, ParallelReplicas, s3, parallel) / 02770_async_buffer_ignore flaky, S3 profile-event count differs (4 66446 66446 vs 4 66446 68007); 19 hits / 17 unrelated PRs + 3 master, 30d #107298 (ours, open)
Stress test (arm_msan) / Segmentation fault (STID 4348-2010) AArch64-MSan fiber-switch false positive in RemoteQueryExecutorReadContext (boost fiber_ucontext MSan shadow loss); the boost bump that fixes it IS already on this branch, so it did not resolve this occurrence a fix task is moved to pending (investigating at full effort - fixing-PR link to follow here)
Upgrade check (amd_release) / Error message in clickhouse-server.log benign leftover-test-state leak: a fabricated plaintext txn_version.txt in a part directory cannot be parsed on an object-storage disk after the upgrade restart (Code: 27 -> Code: 246 intersecting parts). 94 hits / 80 unrelated PRs, 0 master, 30d #111922 (ours, open)
Mergeable Check / PR rollups of the above owned via the rows above
CH Inc sync - CH Inc sync (private, not actionable)

No failure is PR-caused: this PR adds ReadNothingStep serialization plus one stateless test, and
Config Workflow, Finish Workflow, Fast test (amd + arm_darwin) and Style check are green. The
new test 04628_read_nothing_step_serializable passed on every shard.

I merged master (8d4183ba218fba) so the next run picks up #111991; that clears the first line.

Session id: cron:our-pr-ci-monitor:20260727-000000

@clickhouse-gh

clickhouse-gh Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.30% 86.30% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 78.40% 78.40% +0.00%

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

Full report · Diff report

@alexey-milovidov alexey-milovidov added the comp-distributed Distributed table engine & query routing across shards (sharding/load balancing). label Jul 27, 2026
@alexey-milovidov alexey-milovidov self-assigned this Jul 27, 2026

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

LGTM

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 27, 2026
Merged via the queue into ClickHouse:master with commit cbd4045 Jul 27, 2026
178 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 27, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Discharging the ledger row above: Stress test (arm_msan) / Segmentation fault (STID: 4348-2010) now has a fixing pull request, #112124.

One correction to that row's reason column. It said the boost bump that fixes it was already on the branch, so the bump did not resolve that occurrence. That reads as though the bump were the fix; it is not. The merged boost work addresses a different aarch64 MemorySanitizer fiber defect — dirty shadow from struct padding on the fiber stack — and its content is compiled into the very binary that produced this crash, which is why the signature fired anyway. Both are needed.

The actual cause is not a false positive either. On aarch64 with -fsanitize=memory, clang materialises the thread pointer (mrs xN, TPIDR_EL0) into a callee-saved register and keeps it live across a call; when that call switches to another OS thread's stack, the register still names the old thread, so the next shadow-TLS access dereferences an address unmapped in the current thread. This is visible at instruction level in the exact failing binary: the thread pointer is read once in boost::context::fiber::resume()'s prologue and stored through on the force_unwind throw path, which skips the epilogue reload. x86-64 is immune because its MemorySanitizer TLS is segment-relative and resolved per access.

#112124 makes the crash unreachable in that one configuration by compiling the fiber-backed remote-I/O paths out of it, at the five places that already choose between an asynchronous and a synchronous implementation. Verification is the signature count over three or more weeks, not a single green run.

alexey-milovidov added a commit that referenced this pull request Aug 14, 2026
…erializable

Make ReadNothingStep serializable for distributed query plans
robot-ch-test-poll added a commit that referenced this pull request Aug 14, 2026
Cherry pick #111941 to 26.6: Make ReadNothingStep serializable for distributed query plans
robot-clickhouse added a commit that referenced this pull request Aug 14, 2026
robot-ch-test-poll added a commit that referenced this pull request Aug 14, 2026
Cherry pick #111941 to 26.7: Make ReadNothingStep serializable for distributed query plans
robot-clickhouse added a commit that referenced this pull request Aug 14, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Aug 14, 2026
clickhouse-gh Bot added a commit that referenced this pull request Aug 14, 2026
Backport #111941 to 26.7: Make ReadNothingStep serializable for distributed query plans
clickhouse-gh Bot added a commit that referenced this pull request Aug 17, 2026
Backport #111941 to 26.6: Make ReadNothingStep serializable for distributed query plans
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-distributed Distributed table engine & query routing across shards (sharding/load balancing). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-improvement Pull request with some product improvements 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.6-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants