Repository navigation
Explain analyze works for Streaming queries - #112445
Conversation
|
Workflow [PR], commit [ba22518] Summary: ✅
AI ReviewSummaryThis PR removes the Findings❌ Blockers
Final Verdict❌ Changes required before merge. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 25/25 (100.00%) · Uncovered code |
| inputs.emplace_back(pipeline_output->getHeader(), this); | ||
| connect(*pipeline_output, inputs.back()); | ||
| inputs.back().setNeeded(); | ||
| shareQueryPlanStepWithSubPipeline(processors, getQueryPlanStepGroup()); |
There was a problem hiding this comment.
shareQueryPlanStepWithSubPipeline fixes the LazyReadReplacingFinalSource arm, but the lazy-FINAL plan still has a second runtime-expanded arm that is left untouched: LazilyUnorderedReadFromMergeTreeSource::updatePipeline detaches processors built from a stack-allocated ReadFromMergeTree step in buildPipe() and never re-parents them.
That branch is still reachable from the newly-enabled streaming path: MergeTreeCommitOrderSequentialSource::buildPartitionReadingPipeline preserves the original SelectQueryInfo, plan.optimize() can apply optimizeLazyFinal, and the true branch there creates LazilyUnorderedReadFromMergeTree. For a query like EXPLAIN ANALYZE SELECT ... FINAL STREAM WHERE ... LIMIT ... on ReplacingMergeTree, those processors keep a step pointer the wall-clock registry never populated, so ExecutionThreadContext::executeTask still hits chassert(clock) in debug/ASan builds (and release silently drops the timing for that branch).
Please tag that sub-pipeline as well, or clear its transient step pointers so the executor can inherit the parent step before we consider streaming EXPLAIN ANALYZE fixed.
There was a problem hiding this comment.
The idea of this patch is not to retag the processors using this new function in every place. We do this only in processors that create their own plan inside, and thus their processors can get tagged with the steps from this plan. Thus, the steps assigned to those processors (created from internal local plan) get non-null step, which then causes chassert firing in EXPLAIN ANALYZE, cause we cannot find clocks for those steps.
For the case of LazyUnorderedReadFromMergeTreeSource::updatePipeline there is no such problem. We create processors in ReadFromMergeTree::initializePipeline, and this function creates processors with nullptr steps, which then get their step assigned in ExecutingGraph::updatePipeline.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 27/29 (93.10%) · Uncovered code |
…n-analyze-streaming-queries
Build profile diff (arm_release)Comparing ✅ No significant changes. 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. Compile time of recompiled translation units9 translation units recompiled, 31 s compile time in total, 9 of them have a recent master baseline. |
Edited following .claude/skills/edit-changelog/SKILL.md, by hand on a workstation: the editing step of the NightlyChangelog job has been failing its own verification since 2026-08-12, so three raw blocks had accumulated (47 + 84 + 628 entries). Of the 759 raw entries, 482 are integrated into the in-progress 26.8 section and 277 are dropped: - Section 3: the 300 `NOT FOR CHANGELOG / INSIGNIFICANT` entries are dropped, except 41 that describe a user-visible change and are promoted into a real category, among them a server abort on a corrupt `ORC` stripe footer (#114924), `EXPLAIN ANALYZE` for streaming queries (#112445), `SELECT` from `TimeSeries` (#115622), streaming watermarks (#106169), and the `clickhouse-local` CORS overrides (#115129). - Section 2: every revert in the range cancels out inside it, so neither side appears. Two are re-applications: #114912 re-applies the `accurateCastOrDefault` fix, so #109946 keeps its entry with both links and the intervening revert #114911 is gone; #114409 re-applies the PromQL streaming plan, recorded on the #113656 entry. - Section 4: `Build/Testing/Packaging Improvement` keeps the seven entries a user, packager or from-source builder notices (musl `getaddrinfo` and `sched_getcpu`, signed macOS artifacts, Debian packages for release builds only, zstd-compressed Docker layers, `unit_tests_dbms` without the full library set, vendored Rust built with optimizations locally) and drops the CI plumbing. - Sections 5 and 6: bare pull request URLs converted to links, settings put in backticks, four entries rewritten from developer notes into user-visible descriptions, and three moved into `Performance Improvement`. No entry of a strict-retention category was deleted: the job's own `verify_edit` passes on this edit. Not done here, because the release manager does it at release time: the full significance sort, the aggressive merging of sibling pull requests, and the `FIXME` release date and presentation links.
Closes: #112328
Changelog category (leave one):