Repository navigation
Attach the pipeline dump only to a logical error from building the executing graph - #125706
Conversation
…ecuting graph The `PipelineExecutor` constructor appended a `printPipeline` dump to any exception thrown while the `ExecutingGraph` was built. Besides a `LOGICAL_ERROR` (a malformed pipeline, which the dump is for), the only error there is a failed allocation, which says nothing about the pipeline, while the dump costs ~80 bytes per processor. Since ClickHouse#121503 the exception text is also copied into every `processors_profile_log` row of the query, so the cost became quadratic in the number of processors. In `Stress test (amd_tsan)` three cancelled `urlCluster` secondaries with 25,902 processors each hit an injected memory limit there, then spent ~9 minutes copying ~55 GB per query into the log queue and pushed the server over its total memory limit. Attach the dump only to a `LOGICAL_ERROR`. Add the `executing_graph_build_fail` failpoint, which raises a memory-limit error from the graph construction, and a test that such an error carries no dump. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop the sentence in the PipelineExecutor ctor catch that only explained the new LOGICAL_ERROR guard. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review: my own cold review plus an independent model (engine: codex; 0 findings). 1 nit, no change.
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-48:20261013-223700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261013-221300 |
|
Workflow [PR], commit [9f112f7] Summary: ✅
AI ReviewSummaryPR #125706, reviewed at Missing context / blind spots
Final VerdictStatus: ✅ Approve |
|
it can't be 55 gib, provide the proof |
|
55 GB (51.5 GiB) is the exception text copied into L and N, from the CI
The same path, measured locally (debug build of this branch with the 3,961,820,863 = 7,007 x 565,409. In CI the 55 GB was never resident at once. The queue flushes every ~8 s, those flushes failed and dropped their rows, and RSS stayed at 40-50 GiB. Raw lines from processors_profile_log flushes, 22:50-22:59Ten flushes failed between 22:52:19 and 22:58:48; five are shown. Between the last good flush (offset 94902) and 22:58:52 (offset 176798), 81,896 rows were queued, consistent with 3 x 25,902 = 77,706 rows from the three secondaries plus other queries. |
Build profile diff (arm_release)Commit See the job log for details. |
# Conflicts: # src/Common/FailPoint.cpp # src/Processors/Executors/Runtime/V1/ExecutingGraph.cpp
…-build-error-pipeline-dump Resolve the conflict with ClickHouse#126029 in the `PipelineExecutor` constructor's catch: keep the `LOGICAL_ERROR` guard and take master's `printPipeline` call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
26.10 is missing this fix. The That now kills the server in The diff applies cleanly to |
Related: #121503
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Found by
Stress test (amd_tsan)on #118699 (report):Hung check failed, possible deadlock found. Three cancelledurlClustersecondaries of04035_url_cluster_callback_cancel_race(25,902 processors each) hit an injected memory limit while theirExecutingGraphwas built, then spent about 9 minutes inlogProcessorProfile. Meanwhile the server went over its total memory limit, system log flushes and merges failed, and new connections were rejected.The
PipelineExecutorconstructor appended aprintPipelinedump, about 80 bytes per processor, to any exception from building the graph. The dump is for aLOGICAL_ERROR(a malformed pipeline); the only other error there is a failed allocation, which says nothing about the pipeline. Since #121503 the exception text is copied into everyprocessors_profile_logrow of the query, so the copied text is quadratic in the number of processors: 25,902 rows x 2.13 MB, about 55 GB per query here. Not all of it is resident at once, but enough is to get the server OOM-killed:Stress test (amd_debug)on #100377 (report), the same 25,902-processor query.The dump is now attached only to a
LOGICAL_ERROR; that case is unchanged. A new failpointexecuting_graph_build_failraisesMEMORY_LIMIT_EXCEEDEDfrom theExecutingGraphconstructor, and the new test checks that the error carries no dump (it fails without the change).Validation (debug build, a 7,007-processor
numbers_mtquery with the failpoint): before, each of the 7,007processors_profile_logrows carried a 565 KB exception, 3.96 GB in total, and the client got a 565 KB error; after, 120 bytes per row, 0.84 MB in total.In a release build, a real
LOGICAL_ERRORfrom a very large pipeline still copies the dump into every row; keeping the dump for that case is its purpose.Workflow [PR]
Sync PR [sync-upstream/pr/125706]
Version info
26.11.1.126-master(included in26.11and later)