Skip to content

Reintroduce EXPLAIN ANALYZE with a fix for the logical error over a streaming read - #110164

Closed
alexey-milovidov wants to merge 21 commits into
masterfrom
fix-explain-analyze-wall-clock-crash
Closed

alexey-milovidov wants to merge 21 commits into
masterfrom
fix-explain-analyze-wall-clock-crash

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

EXPLAIN ANALYZE (added in #106586) was reverted in #110162 because of a Logical error: 'clock' abort in debug and sanitizer builds when run over a streaming (FROM ... STREAM) read. This pull request reintroduces the feature and fixes that bug, so it can land safely.

The first commit reintroduces the feature by reverting #110162 (a git revert -m 1 of the revert merge). It is an exact inverse: the reintroduced tree is byte-identical to master right before the revert, so the previously hand-resolved 03269_explain_unique_ids.reference conflict is restored correctly.

The second commit fixes the bug. EXPLAIN ANALYZE attributes per-step wall-clock time by looking up each processor's query plan step in a StepWallClockRegistry populated from the walked query plan. ExecutionThreadContext::executeTask asserted with chassert(clock) that every step-attributed processor has a registered clock. That invariant does not hold: a streaming read expands its pipeline at run time via expandPipeline and splices in a source built from a transient nested query plan; the source keeps that plan's ReadFromMergeTree step even after the nested plan is destroyed, so its step is not part of the plan walked by populateFromPlan and find returns null. Release builds already tolerated this via the following if (clock) guard; only the chassert aborted. The fix removes the assertion and simply does not time such processors, matching the release behavior. AnalyzeStepsStats already tolerates these steps — it only uses the step pointer as a map key or for identity comparison and never dereferences it, and it prints stats only for steps of the walked plan.

Known limitation: runtime-expanded streaming processors are therefore not accounted for in the per-step timing of EXPLAIN ANALYZE. Forbidding EXPLAIN ANALYZE for streaming queries outright is the alternative proposed in #110077.

Because EXPLAIN ANALYZE executes the inner SELECT, a follow-up commit also aligns its transaction handling with that behavior: it is now rejected in a failed (ROLLED_BACK) transaction like a plain SELECT, instead of passing through the non-executing EXPLAIN exemption (regression test 04540_explain_analyze_failed_transaction).
Found by the AST fuzzer wrapping a query from 04411_streaming_distinct_in_order into EXPLAIN ANALYZE.

CI report (revert-triggering failure): https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=ec064681ee99d6f2c0153607a0cb49bb190c30cc&name_0=MasterCI&name_1=Stress%20test%20%28azure%2C%20amd_msan%29

Changelog category (leave one):

  • New Feature

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

Adding EXPLAIN ANALYZE v1 for examination of query performance using metrics rendered in the familiar query plan format.

Documentation entry for user-facing changes

  • Documentation is written (the feature's documentation is reintroduced together with the code).

@clickhouse-gh

clickhouse-gh Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4f65bdd]


AI Review

Summary

This PR reintroduces EXPLAIN ANALYZE, adds per-step runtime accounting, and switches FROM ... STREAM from the earlier debug-only exception to an explicit NOT_IMPLEMENTED rejection. The current head still has a few user-visible contract gaps in the report it produces, so I would keep this at request changes.

Findings

⚠️ Majors

  • [src/Processors/QueryPlan/AnalyzePlanStats.cpp:85] Skipping every processor whose elapsed_ns stayed at 0 makes parallelism <avg>/<max> and Time per processor (<n>) drop idle workers entirely. A skewed 16-way stage where only one worker sees data is reported as 1/1 with one processor instead of 1/16, which removes the main load-skew signal that processors = 1 is meant to expose.
    Suggested fix: count every processor in total_num_processors and keep zeroes in the distribution, or at minimum compute <n> and the max side of parallelism from the full stage width rather than only the non-zero subset.
  • [src/Interpreters/InterpreterExplainQuery.cpp:796] The cached inner plan copies query_plan_max_step_description_length before InterpreterSetQuery::applySettingsFromQuery mutates the planning context, so EXPLAIN ANALYZE ... SETTINGS query_plan_max_step_description_length = N still builds step descriptions with the session default and cannot be corrected later.
    Suggested fix: move the inner_options.max_step_description_length assignment after applying the query settings, or read the value back from planning_context when constructing the inner interpreter.
  • [src/Interpreters/InterpreterExplainQuery.cpp:1193] Precomputing only PrettyNamesPerPlan before buildQueryPipeline preserves step names, but not the rest of the EXPLAIN PLAN surface. Steps such as ExpressionStep and FilterStep move their ActionsDAG into the pipeline, so EXPLAIN ANALYZE actions = 1, compact = 0 loses the action breakdown even though the docs say it accepts the same display options as EXPLAIN PLAN.
    Suggested fix: snapshot the explainable step state before consuming the plan, or explain a cloned plan and stitch the runtime stats into that copy.
  • [src/Interpreters/InterpreterExplainQuery.cpp:1267] Peak memory is read from the child analyze_thread_group, but planning, optimization, and pipeline construction all happen on the outer query thread group. Any peak hit before executor.execute() is therefore omitted even though the header and docs describe whole-query peak memory.
    Suggested fix: report the outer group peak, or otherwise combine planning and execution peaks.
Tests
  • ⚠️ Add a focused regression for EXPLAIN ANALYZE actions = 1, compact = 0 ... that asserts the action breakdown survives after execution, not just the step names.
  • ⚠️ Add a focused regression for EXPLAIN ANALYZE ... SETTINGS query_plan_max_step_description_length = <tiny value> so the cached analyze plan proves it uses the per-query limit.
Final Verdict
  • Status: ⚠️ Request changes

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 12, 2026
@Michicosun

Copy link
Copy Markdown
Member

I'd rather suggest forbidding the running of streaming queries with explain analyze, since it is a concept mismatch.

alexey-milovidov and others added 3 commits July 12, 2026 17:32
Reintroduces the `EXPLAIN ANALYZE` feature (originally #106586) by reverting
its revert #110162 (merge commit 178267d, reverted with `-m 1`).

The feature was reverted only because of a `Logical error: 'clock'` abort in
`EXPLAIN ANALYZE` over a streaming (`FROM ... STREAM`) read in debug and
sanitizer builds. The following commit fixes that bug, so the feature can be
reintroduced.

This restores the query-executor instrumentation (`StepWallClock`,
`StepWallClockRegistry`, `AnalyzePlanStats`, per-step wall-clock and per-port
data accounting on `IProcessor`, per-stage processor grouping on
`SortingStep`/`AggregatingStep`/`JoinStep`), the `ANALYZE` keyword and its
handling in `ParserExplainQuery`/`InterpreterExplainQuery`,
`StreamLocalLimits::forQueryResult`, and the associated tests and documentation.

Related: #106586
Related: #110162

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`EXPLAIN ANALYZE` attributes per-step wall-clock time by looking up each
processor's query plan step in a `StepWallClockRegistry` populated from the
walked query plan. `ExecutionThreadContext::executeTask` asserted with
`chassert(clock)` that every step-attributed processor has a registered clock.

That invariant does not hold. A streaming (`FROM ... STREAM`) read expands its
pipeline at run time via `expandPipeline` and splices in a source built from a
transient nested query plan; the source keeps that plan's `ReadFromMergeTree`
step even after the nested plan is destroyed, so its step is not part of the
plan walked by `populateFromPlan`, and `find` returns null. In debug and
sanitizer builds the `chassert` then aborted with `Logical error: 'clock'`
(the failed-expression text). Release builds already handled the null clock
gracefully via the following `if (clock)` guard.

Remove the assertion and simply skip timing for such processors, matching the
release behavior. `AnalyzeStepsStats` already tolerates these steps: it only
uses the step pointer as a map key or for identity comparison and never
dereferences it, and it prints stats only for steps of the walked plan.

Found by the AST fuzzer wrapping a query from
`04411_streaming_distinct_in_order` into `EXPLAIN ANALYZE`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=ec064681ee99d6f2c0153607a0cb49bb190c30cc&name_0=MasterCI&name_1=Stress%20test%20%28azure%2C%20amd_msan%29

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@alexey-milovidov
alexey-milovidov force-pushed the fix-explain-analyze-wall-clock-crash branch from d3c6e9d to bad3f40 Compare July 12, 2026 17:40
@mintlify

mintlify Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ClickHouse-docs 🟢 Ready View Preview Jul 12, 2026, 6:44 PM

@alexey-milovidov alexey-milovidov changed the title Fix logical error in EXPLAIN ANALYZE over a streaming read Reintroduce EXPLAIN ANALYZE with a fix for the logical error over a streaming read Jul 12, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Restructured: since #110162 (the revert of EXPLAIN ANALYZE) has now merged into master, this PR reintroduces the feature (revert of #110162) and applies the streaming-read fix on top. The reintroduction is an exact inverse of the revert (identical tree to master right before it), so nothing else changes.

Regarding the timing concern: this keeps the "do not time runtime-expanded streaming processors" behavior. Forbidding EXPLAIN ANALYZE over FROM ... STREAM entirely is the alternative in #110077 — happy to switch to that if preferred, but this path keeps the feature usable for streaming reads (survives, just without per-step timing for the run-time-spliced snapshot pipeline).

@clickhouse-gh clickhouse-gh Bot added pr-feature Pull request with new product feature and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Jul 12, 2026
…ANALYZE test

The regression test only proved that `EXPLAIN ANALYZE` over a streaming
read no longer aborts. Strengthen it to assert the chosen behavior
structurally, following the pattern of `04312_explain_analyze`: the query
summary block is present with all its fields (`Time:`, `Read:`,
`Peak memory:`), and the steps of the walked outer plan are rendered and
annotated (`ReadFromMergeTree`, `Limit`, per-step `time` and
`parallelism` fields). Note that the rows and bytes read by the
run-time-expanded snapshot processors still reach the summary `Read:`
counters; only their per-step wall-clock attribution is skipped.

Verified against a debug build (where the removed `chassert` is active):
the test output matches the reference.

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread src/Interpreters/executeQuery.cpp Resolved
alexey-milovidov and others added 2 commits July 12, 2026 22:24
`EXPLAIN ANALYZE` executes the inner `SELECT`, so once a transaction has
failed (its state is `ROLLED_BACK`) it must be rejected exactly like the
query it wraps. The failed-transaction gate in `executeQueryImpl` treated
every `ASTExplainQuery` as a "special" (non-executing) query and let it
through, so `EXPLAIN ANALYZE SELECT ...` still planned and executed the
inner `SELECT` against the failed transaction even though a plain `SELECT`
is rejected there.

Exclude `ExplainKind::Analyze` from that exemption. Other `EXPLAIN` kinds do
not execute the inner query (they only print a plan) and stay special, as do
transaction-control statements so a failed transaction can still be rolled
back.

Addresses a review finding on the EXPLAIN ANALYZE reintroduction
(#110164).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
alexey-milovidov and others added 3 commits July 13, 2026 03:30
The style check (`ci/jobs/check_style.py`) rejects any test whose file
name contains the substring `fail`, so
`04540_explain_analyze_failed_transaction` failed `functional_tests_check`.
Rename it to `04540_explain_analyze_rolled_back_transaction`, which
describes the same scenario (a `ROLLED_BACK` transaction) without the
forbidden word.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

const size_t group = proc->getQueryPlanStepGroup();
const UInt64 group_elapsed = proc->getElapsedNs();
if (group_elapsed == 0)

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.

Skipping group_elapsed == 0 here makes EXPLAIN ANALYZE hide idle processors from both parallelism <avg>/<max> and Time per processor (<n>). For a 16-way stage where only one worker actually sees data, the report becomes parallelism 1/1 with Time per processor (1) instead of showing the 15 zero-time workers, which is exactly the load-skew signal the new processors = 1 mode is supposed to surface.

Please count every processor in the stage, and either include zeroes in the per-processor distribution or at least keep total_num_processors based on the full stage width rather than only the non-zero subset.


UInt64 read_rows = analyze_thread_group->performance_counters[ProfileEvents::SelectedRows];
UInt64 read_bytes = analyze_thread_group->performance_counters[ProfileEvents::SelectedBytes];
Int64 peak_memory = analyze_thread_group->memory_tracker.getPeak();

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.

Peak memory is taken from analyze_thread_group, but that child group is created only immediately before executor.execute(). Planning, optimization, and pipeline construction all happen on the outer query thread group, and child groups are parented to that outer memory_tracker, so any peak hit during planning is dropped from the reported header.

That makes EXPLAIN ANALYZE systematically under-report memory for plan-heavy queries even though the header and docs describe peak memory for the whole query. Please read the peak from the outer query group (or otherwise combine planning and execution peaks) here.

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

chassert was there way to check in debug build if we undercount the time of execution of different operators. Otherwise EXPLAIN ANALYZE silently might return wrong values, and no one would be able to find this, because it is not something that is easy to track on its own.

I would suggest to leave chassert where it was, and reject STREAMING QUERIES in favor in the way as suggested by @Michicosun in #110077 (comment).

We might not want to keep chassert, because it might eventually break CI. We might choose some other, more silent mechanism, that does not break CI, such as sending a LOG for example. But to me it seems, that it is better to fail loudly so that we can spot the problem early and do revert->fix->merge rather than relying that someone will notice an error and report it as an issue.

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

Here is what I would suggest to implement, based on the comment of @Michicosun. I can also do it as a separate fix outside of this PR right after this one merged, if you wish.

Comment on lines +112 to +116
/// A processor can carry a query plan step that is not part of the plan walked by
/// `populateFromPlan`, so `find` legitimately returns null. This happens for processors
/// added at run time by `expandPipeline` (lazy reads, streaming reads, external sort, ...):
/// such a processor may be built from a transient nested query plan and keep that plan's
/// step even after the nested plan is destroyed. We simply do not time these processors.

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.

Suggested change
/// A processor can carry a query plan step that is not part of the plan walked by
/// `populateFromPlan`, so `find` legitimately returns null. This happens for processors
/// added at run time by `expandPipeline` (lazy reads, streaming reads, external sort, ...):
/// such a processor may be built from a transient nested query plan and keep that plan's
/// step even after the nested plan is destroyed. We simply do not time these processors.
chassert(clock);

Test `04540_explain_analyze_rolled_back_transaction` failed reproducibly in the
`old analyzer` CI job: it used `EXPLAIN SYNTAX SELECT 1`, whose normalized output
depends on the analyzer (the new analyzer adds the implicit `FROM system.one`,
the old one does not), while the reference was generated under the default (new)
analyzer.

Switch the "non-executing EXPLAIN stays allowed" check to `EXPLAIN AST SELECT 1`,
which dumps the parsed AST before analysis and is therefore byte-identical under
both analyzers. `EXPLAIN AST` is still a non-executing `ExplainKind` (not
`Analyze`), so it remains exempt from the failed-transaction gate and exercises
the same code path.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110164&sha=b42879c4a553859463bec70dcfaea0cd63c0d2f6&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20old%20analyzer%2C%20s3%20storage%2C%20DBReplicated%2C%20WasmEdge%2C%20parallel%2C%203%2F3%29
PR: #110164

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
plan.optimize(optimization_settings);
planning_ns += watch.elapsed();

/// Build the per-plan pretty-names registry now: buildQueryPipeline below moves the ActionsDAGs

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.

EXPLAIN ANALYZE still explains the consumed plan after buildQueryPipeline / executor.execute(), but only the pretty names are snapshotted here. That does not preserve the rest of the EXPLAIN PLAN surface: ExpressionStep::transformPipeline and FilterStep::transformPipeline both std::move their ActionsDAG into the pipeline, so compact = 0, actions = 1 loses the action breakdown even though ANALYZE advertises the same display options as EXPLAIN PLAN. Please snapshot the explainable step state before consuming the plan (or explain a cloned plan and stitch the runtime stats into that) instead of caching names only, and add a focused regression for compact = 0.

inner_options.setExplain();

auto planning_context = Context::createCopy(getContext());
inner_options.max_step_description_length = planning_context->getSettingsRef()[Setting::query_plan_max_step_description_length];

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.

EXPLAIN ANALYZE ... SETTINGS query_plan_max_step_description_length = N still builds and caches the inner plan with the session default here, because inner_options.max_step_description_length is copied before InterpreterSetQuery::applySettingsFromQuery mutates planning_context. Once analyzed_inner_query holds that plan, the later render cannot recover the requested truncation: long step descriptions were already generated at the wrong length.

Please move this assignment after InterpreterSetQuery::applySettingsFromQuery (or read the limit back from planning_context when constructing the inner interpreters), and add a regression that forces a long step description under a tiny query_plan_max_step_description_length.

alexey-milovidov and others added 6 commits July 15, 2026 03:09
The last few commits (applying reviewer suggestions to switch the
streaming-read fix from "silently skip timing" to "reject EXPLAIN
ANALYZE over FROM ... STREAM up front") left the build broken:
`rejectStreamingForExplainAnalyze` was defined but never called, and
`extractTableExpressions` was used without including `Analyzer/Utils.h`.

- Add the missing `#include <Analyzer/Utils.h>`.
- Call `rejectStreamingForExplainAnalyze(query_tree)` after the
  analyzer/non-analyzer branches in `getAnalyzedInnerQuery`, matching
  the suggested placement.
- Fix a stray one-space indent left by the suggestion-commit UI.
- `04538_explain_analyze_stream_read.reference` was not updated to
  match the rewritten `.sql` (which now only expects two
  `NOT_IMPLEMENTED` errors and no query output) - empty it accordingly.
- Fix a comment that referred to a nonexistent `extractAllTableReferences`
  function; the actual function is `extractTableExpressions`.
- Reword a `04540` test comment per the style-check nit ("new analyzer"
  -> "the analyzer").

Verified: the two EXPLAIN ANALYZE / STREAM cases in 04538 now correctly
throw NOT_IMPLEMENTED (checked with `clickhouse local`), and a plain
non-streaming EXPLAIN ANALYZE still works.
@clickhouse-gh

clickhouse-gh Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 28.60% 85.80% +57.20%
Functions 39.40% 92.70% +53.30%
Branches 20.60% 78.00% +57.40%

Changed lines: Changed C/C++ lines covered: 764/850 (89.88%) · Uncovered code

Full report · Diff report

…TableFunctionNode.h

rejectStreamingForExplainAnalyze uses TableNode::as<>() and
TableFunctionNode::as<>(), whose complete type definitions were only
reaching this translation unit transitively. Add the explicit
includes as suggested in review.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

@groeneai, two CI failures on 362b3c961e3 (prior head, before merging master in this pass) are unrelated to this PR's EXPLAIN ANALYZE changes:

  1. Integration tests (amd_tsan, 3/6): test_replicated_database/test.py::test_replicated_table_structure_alter — tracked by Flaky test: test_replicated_database/test.py::test_replicated_table_structure_alter (regression since 2026-07-10) #110036 (open master-wide regression since 2026-07-10, no fix yet). Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110164&sha=362b3c961e30ab874bde03efcd12e2c8da5e27d3&name_0=PR&name_1=Integration%20tests%20%28amd_tsan%2C%203%2F6%29

  2. Stress test (arm_msan): MemorySanitizer: use-of-uninitialized-value immediately followed by MemorySanitizer: nested bug in the same thread, aborting / LLVM ERROR: IO failure on output stream: Broken pipe — the actual stack trace is lost because the MSan symbolizer itself trips a second use-of-uninitialized-value report while printing the first, aborting before any user frame is printed. This is the same symbolizer meta-issue previously tracked (for the BuzzHouse variant) in BuzzHouse amd_msan use-of-uninitialized-value (STID: None) — symbolizer aborts on nested MSan report, all stacks lost #106591, closed once its one specific root cause was fixed. It keeps recurring for unrelated causes: over the last 30 days it has hit Stress test on 14 different, unrelated PRs and master itself (pull_request_number = 0, 2026-07-07), each presumably a different underlying uninitialized-value bug whose stack is lost to the same symbolizer abort. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110164&sha=362b3c961e30ab874bde03efcd12e2c8da5e27d3&name_0=PR&name_1=Stress%20test%20%28arm_msan%29

Could you investigate and provide a fix in a separate PR? For (2), since each occurrence's stack is unrecoverable after the fact, a fix likely means addressing the symbolizer's nested-bug/broken-pipe abort itself (as raised in #106591) so future hits are actually diagnosable, and/or opening a fresh tracking issue for the Stress test family analogous to #106591. If a fix is already in progress, please link it here.

@groeneai

Copy link
Copy Markdown
Collaborator

@alexey-milovidov Both are unrelated to this PR's EXPLAIN ANALYZE changes, confirmed:

1. test_replicated_table_structure_alter (amd_tsan) is the #110036 master-wide regression. It is a timing-exposed pre-existing DatabaseReplicated recovery race, not a new code regression: recoverLostReplica does not rewrite matching-UUID RMT tables, so metadata_version converges asynchronously after SYSTEM SYNC REPLICA, and the recovered replica can be read at its pre-ALTER structure in a narrow window that msan/tsan widen. Our fix is #110030 (converts the assertion to assert_eq_with_retry), open.

2. Stress test (arm_msan) use-of-uninitialized-value -> nested bug in the same thread, aborting / Broken pipe is the same AArch64 MSan family I investigated for #110102. The dominant known cause: boost fiber stacks are heap-allocated (aligned_alloc) so MSan treats them as uninitialized, and LLVM loses MSan shadow for struct-padding bytes in fiber-resume return values (llvm/llvm-project#54476); the dirty shadow accumulates across context switches. Fix in progress: #110152 (bump contrib/boost to pull the fiber-switch fix), open; tracking issue #110124.

On the symbolizer meta-point: the nested bug ... aborting is MSan hitting a second report while printing the first, which is why the stack is lost. #110152 removes the dominant (fiber-switch) source of those reports on AArch64. Because the stack of any individual hit is unrecoverable after the fact, I cannot prove this specific 362b3c9 hit is fiber-switch rather than a distinct uninit bug; if #110152 does not fully quiet the Stress test (arm_msan) family, the remaining recurrences would each be a different underlying uninitialized-value bug still losing its stack to the same abort. Happy to open a dedicated Stress-family tracking issue (analogous to #106591) if you want one separate from #110124.

No separate PR is needed here beyond #110030 and #110152.

@Fgrtue

Fgrtue commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The work started in this PR will be continued in #110668

@Fgrtue Fgrtue closed this Jul 16, 2026
alexey-milovidov added a commit to filimonov/ClickHouse that referenced this pull request Aug 2, 2026
… was reintroduced

`EXPLAIN ANALYZE` was reverted from master in ClickHouse#110162 and reintroduced in ClickHouse#110164,
so the merge brings back `InterpreterExplainQuery.cpp`, which builds its accounting
group with `std::make_shared<ThreadGroup>(outer_thread_group)`. This branch makes the
borrowing `ThreadGroup` constructor private so borrowed groups are created only through
factories, so the merge does not compile: `calling a private constructor of class
'DB::ThreadGroup'`.

Re-add the `createForExplainAnalyze` factory (matching `createForMaterializedView` and
`createForFlushAsyncInsertQueue`) and use it at the call site. This is the same change as
9b8462b, which was dropped by the previous merge because master had `EXPLAIN ANALYZE`
reverted at the time.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

This branch was successfully deployed

1 active deployment
staging - docs — 4f65bdd8 Deployed Jul 16, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull request with new product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants