Repository navigation
Disambiguate processors in the ExecutingGraph::addEdge exception - #112745
Conversation
When `ExecutingGraph::addEdge` finds a connected peer that is missing from the list of processors, the thrown `LOGICAL_ERROR` named both endpoints of the broken edge via `getName`, which is ambiguous when several processors share a name. Use `getUniqID` (the name plus the per-thread processor index) for both endpoints instead; both processors are alive at this point, so the call is safe. This recovers the disambiguation previously provided by the out-of-set node rendering that was removed from `printPipeline` in #110955. Related: #110955 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [0190155] Summary: ✅
AI ReviewSummaryThis PR makes the malformed-pipeline diagnostic from Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 57/57 (100.00%) · Uncovered code |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 2/7 (28.57%) · Uncovered code |
…sage The review of #112745 asked for focused coverage of the only observable contract of the change: when `ExecutingGraph::addEdge` finds a connected peer that is missing from the list of processors, the thrown `LOGICAL_ERROR` must name both endpoints via `getUniqID` (distinct per-thread `_N` suffixes), not the ambiguous `getName`. The test builds a source connected to a sink that is deliberately omitted from the list of processors and asserts the exception message contains both `getUniqID` values. In debug and sanitizer builds, where a logical error aborts at the throw site, the same contract is pinned through a death test matching the abort message. Co-Authored-By: Claude Fable 5 <[email protected]>
`getUniqID` distinguishes repeated processor classes only while `CurrentThread` is initialized. Outside a query thread `IProcessor` assigns `processor_index = 0` to every processor, so the malformed-graph diagnostic degraded back to ambiguous `Foo_0` identifiers. Print the processor address alongside `getUniqID`, which keeps the two endpoints of the broken edge distinguishable in every context and lets the reader match them against a pipeline dump. The regression test no longer manufactures a `ThreadStatus`: it now runs in exactly the degraded context and still observes two distinct identifiers. That also fixes the interference the manufactured status caused in the shared unit test binary - the local `ThreadStatus` reset `current_thread` to null on destruction, which broke every later test on the main thread that expects an initialized status (`LimitByTransform.ClearsOutputSlicesWhenTransformThrows` and `LimitBySortedStreamTransform.ClearsOutputSlicesWhenTransformThrows` failed with `Thread #N status was not initialized`). The death test matches the shape of the message rather than the parent process's exact addresses, because the `threadsafe` style re-executes the test binary.
`Unit tests (asan_ubsan)`, `(tsan)` and `(msan)` failed with `Syntax error at index 19 in simple regular expression ...: '[' is unsupported` — ClickHouse builds googletest with `GTEST_HAS_POSIX_RE=0`, so `EXPECT_DEATH` patterns are matched by gtest's own simple engine, which supports neither character classes nor `\d`. Use only `.` and `*`, which both engines accept. Verified against the simple engine directly (`testing::internal::RE::PartialMatch` compiled with `GTEST_HAS_POSIX_RE=0`): the observed message matches, and a message naming the same processor for both endpoints does not.
Build profile diff (arm_release)Comparing Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Object file sizes509 object files changed (+306.95 KiB total), 1 added.
737 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units
|
…esses
The exception from `ExecutingGraph::addEdge` names both endpoints as
`{uniqID} at {address}`, but the pipeline dump that `PipelineExecutor`
appends to it labelled nodes with `getUniqID` only. When `CurrentThread`
is not initialized, `getUniqID` degrades to the `_0` suffix for every
processor, so repeated processor classes in the dump could not be matched
against the endpoints named by the exception.
Add an opt-in `with_addresses` flag to `printPipeline`, enabled only on
this diagnostic path, so the dump uses the same `{uniqID} at {address}`
labels. It stays off by default because addresses are unstable noise in
user-facing output such as `EXPLAIN PIPELINE`. The gtest now also asserts
that the source description reappears verbatim in the appended dump.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=112745&sha=026079509fe2ed66e663d9fe1e30621e34b67f3a&name_0=PR&name_1=AST%20fuzzer%20%28arm_asan_ubsan%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. The failure is the logical error For the record, the other two reds on this head are the known |
|
Investigated. It is the shape tracked by #113184, and that issue still has no fix PR, so I am authoring one and will link it here. Identity. The abort site is #113184 is live. Its reproducer aborts deterministically for me on a debug build of current master ( One thing worth adding to #113184. Its "required ingredients" list says the twice-referenced materialized CTE must appear twice in the join tree. The carrier here does not: It is unrelated to this PR, as you say: no frame in the stack is below On the other two, nothing to add beyond a status note: #111997 is mine and still open awaiting review. |
|
The fix PR promised above is #113489. It targets the shape #113184 tracks: a materialized CTE that reads a Root cause is a build-order interaction rather than a missing check. One thing to be explicit about, since I raised the carrier here: #113489 does not fix the failure on this PR. I re-ran your carrier on both binaries, against a schema whose That also caps what I can say about the precondition I flagged earlier. Every shape I can reproduce duplicates the outer CTE in the join tree or in a This PR remains unrelated to the failure, as you said. |
|
🕵 @groeneai, investigate two unrelated CI failures seen on the previous head (
The third red on that head, |
|
Investigated both. Confirming your reading of the artifacts on each, with one correction on item 2. 1. STID 2270-3258 — fixed by an open PR of mine, #113469No new PR needed. #113469 ("Fix lost rows and LOGICAL_ERROR for a window function over a distributed table with no referenced column") fixes your carrier.
Measured on a real two-shard server, your exact query with only the port rewritten. Fix arm is #113469's head
Five of six carriers I tried discriminate. The sixth (#112871) did not reproduce for me, but that is my paraphrase of the fuzzed query losing the shape, not evidence about coverage. Breadth over 40 days on the exact STID: 15 rows, 14 PRs, 0 master — close to your ~12 since 2026-08-03, and every row is the analyzer shape. One limit I am not claiming past: the same message is also reachable through the old interpreter, and #113469's locus is analyzer-only, so that shape is deliberately out of scope there. No tracking issue: confirmed. 2. STID 0250-4e52 — #113489 does not cover it; the live shape is already tracked by open #107619(a) #113489 does not cover it. It is the materialized-CTE build-order fix, whose symptom is (b) I suggest not reopening #102803, on two measurements:
Your "live again" reading is right: 36 rows after #102803 closed, 18 since 2026-08-01, 7 master hits, most recently So my preference is to record this arm_debug occurrence and the arch measurement on #107619 rather than reopen. If you would rather have one tracker per architecture, say so and I will file it — creating or reopening issues is the one thing I hold for your confirmation. On the fix side, the residual after your merged #107924 is the Agreed on |
|
🕵 Both CI failures on the current head (
Neither fix has landed on master yet, so there is nothing to pull in by re-merging. Review state is clean: zero unresolved threads and the AI verdict on this head is ✅ No new findings. |
Fgrtue
left a comment
There was a problem hiding this comment.
I think we should have used the id that we store in the node of the graph. Because the id that we store in the node is actually the same number that we use when dumping the processors when calling get_proc_id.
If we would like to, we could also print a message like this Processor n{ProcId} AggregatingTransform_X has output port 2 (might be useful for debugging) connected to o0 NullSink, which is not in the list of processors. See n17 and o0 in the pipeline dump below. And after that in principal we could also have printed the additional edge in the dump in DOT format, showing where exactly there should have been the edge.
This probably would make the UI much more friendly for debugging, and also would allow not to have the problems with tracking the address of the processor, which is very tedious in the bulk of text.
Changelog category (leave one):
Description
When
ExecutingGraph::addEdgefinds a connected peer that is missing from the list of processors, the thrownLOGICAL_ERROR("Processor {} was found as {} for processor {}, but not found in list of processors") named both endpoints of the broken edge viagetName, which is ambiguous when several processors share a name. Identify each endpoint bygetUniqID(the name plus the per-thread processor index) and its address instead. Both processors are alive at this point — the missing peer was merely never added to the collection — so the dereference is safe.The address is what makes the diagnostic unconditional:
getUniqIDdisambiguates only whileCurrentThreadis initialized, andIProcessorotherwise assignsprocessor_index = 0to every processor, so outside a query thread the message would degrade back to ambiguousFoo_0identifiers. The address also lets the reader match the endpoints against the pipeline dump that thePipelineExecutorconstructor appends to the exception:printPipelinegained an opt-inwith_addressesflag, enabled only on this diagnostic path, that labels every node with the same{uniqID} at {address}format. It is off by default, so user-facing output such asEXPLAIN PIPELINEkeeps stable labels.This is the follow-up promised in the review of #110955, which removed the rendering of out-of-collection peers from
printPipeline(that rendering dereferenced a potentially dangling peer). For the malformed-graph path in thePipelineExecutorconstructor, the numeric suffix that the removed rendering used to provide is now carried by the exception message itself.A gtest covers the message contract in the degraded, no-
CurrentThreadcontext:Related: #110955
Version info
26.8.1.1060(included in26.8and later)