Repository navigation
Stop exchange sinks when the consumer needs no more data - #114806
Conversation
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [67db020] Summary: ✅
AI ReviewSummaryThis PR makes in-memory and PR Metadata
Findings
Missing context / blind spots
Final VerdictNeeds follow-up before merge: the implementation and test are fine for in-memory / LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 31/32 (96.88%) · Uncovered code |
Co-Authored-By: Claude Fable 5 <[email protected]>
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, 43 s compile time in total, 9 of them have a recent master baseline. |
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
| ) | ||
| SETTINGS make_distributed_plan = 1, enable_parallel_replicas = 0, distributed_plan_execute_locally = 0, | ||
| distributed_plan_default_shuffle_join_bucket_count = 3, distributed_plan_default_reader_bucket_count = 3, | ||
| distributed_plan_max_rows_to_broadcast = 0, distributed_plan_force_exchange_kind = 'Streaming', |
There was a problem hiding this comment.
distributed_plan_execute_locally = 0 can still run this query through Persisted exchanges: that is the auto-selected kind whenever the streaming listener is not configured (QueryPlanOptimizationSettings.cpp:366-372), and users can force it explicitly. This test only exercises Streaming, but ExchangeViaTemporaryFiles still just writes the whole stream (DistributedPlanExecutor.cpp:168-199), so the new user-facing promise is false in that supported mode: those plans still run the upstream stages to completion and discard the rest. Can we either scope the changelog / PR claim to in-memory / Streaming exchanges, or handle or reject the Persisted path too?
A distributed-plan query with a satisfied
LIMITkept all upstream stages running to completion: an exchange sink consumed and dropped the rest of the stream after the consumer sentNoMoreDataNeeded, so the client received the result while the query kept running until cancelled. Now the sink closes its input instead, and the stop propagates backward through the stages the same way a localLimitTransformstops its producers. The in-memory exchange reader also detaches when its output port is closed, not only on cancellation.The new test covers a
LIMITin the middle of the plan: the stage that satisfies it finishes early and the stop crosses two exchange layers down to the scans.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A distributed plan query (
make_distributed_plan) now stops its upstream stages when aLIMITis satisfied, instead of computing the full result and discarding it.🤖 Generated with Claude Code