You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by hu...@apache.org on 2026/04/11 16:49:58 UTC

(doris) branch fe_local_shuffle updated: [fix](local shuffle) Fix COREDUMP: restrict AGG PASSTHROUGH to ScanNode children only

This is an automated email from the ASF dual-hosted git repository.

huajianlan pushed a commit to branch fe_local_shuffle
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/fe_local_shuffle by this push:
     new 830128696c1 [fix](local shuffle) Fix COREDUMP: restrict AGG PASSTHROUGH to ScanNode children only
830128696c1 is described below

commit 830128696c11bd7ed60a433847d21824b6912051
Author: 924060929 <la...@selectdb.com>
AuthorDate: Sun Apr 12 00:49:46 2026 +0800

    [fix](local shuffle) Fix COREDUMP: restrict AGG PASSTHROUGH to ScanNode children only
    
    When AGG operators (streaming, distinct-streaming, serialize) request
    PASSTHROUGH from their child, only do so when the child is a ScanNode
    (pooling scan fan-out). For any other child type (Exchange, AGG, etc.),
    inserting a PASSTHROUGH LE creates a pipeline split that disconnects
    AggSink↔AggSource shared state → DCHECK/SIGSEGV in set_ready_to_read().
    
    This mirrors BE behavior where need_to_local_exchange sees serial
    operators in the pipeline and skips LE insertion. The previous fix
    using !(instanceof ExchangeNode) was insufficient: with
    use_serial_exchange=true, the crashing path involved AGG→AGG chains
    where the inner AGG had a serial Exchange child.
    
    Applied to all 3 AGG branches: distinct-streaming force-passthrough,
    streaming preagg, and serialize no-group-key.
---
 .../org/apache/doris/planner/AggregationNode.java  | 25 +++++++++++-----------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
index ad814c1d4f2..386d86b4b3f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
@@ -286,10 +286,12 @@ public class AggregationNode extends PlanNode {
                     requireChild = parentRequire.autoRequireHash();
                 }
             } else if (sessionVariable.enableDistinctStreamingAggForcePassthrough
-                    && !(children.get(0) instanceof ExchangeNode)) {
-                // Don't request PASSTHROUGH for serial ExchangeNode children — inserting
-                // PASSTHROUGH between Exchange and streaming AGG breaks AggSink↔AggSource
-                // shared state. See streaming preagg branch for detailed explanation.
+                    && children.get(0) instanceof ScanNode) {
+                // Only request PASSTHROUGH when child is a ScanNode (pooling scan fan-out).
+                // For any other serial child (Exchange, AGG, etc.), inserting PASSTHROUGH
+                // creates a pipeline split that breaks AggSink↔AggSource shared state
+                // → DCHECK/SIGSEGV in set_ready_to_read(). In BE, need_to_local_exchange
+                // sees serial operators in the pipeline and skips LE insertion.
                 requireChild = LocalExchangeTypeRequire.requirePassthrough();
             } else {
                 requireChild = LocalExchangeTypeRequire.noRequire();
@@ -303,15 +305,12 @@ public class AggregationNode extends PlanNode {
                 requireChild = LocalExchangeTypeRequire.requirePassthrough();
             } else if (fragment != null && fragment.useSerialSource(connectContext)
                     && children.get(0).isSerialOperator()
-                    && !(children.get(0) instanceof ExchangeNode)) {
+                    && children.get(0) instanceof ScanNode) {
                 // Mirrors BE StreamingAggOperatorX::required_data_distribution():
                 //   return _child->is_serial_operator() ? PASSTHROUGH : NOOP
-                // Only request PASSTHROUGH for serial non-Exchange children (e.g. pooling
-                // OlapScan). For serial ExchangeNode (e.g. UNPARTITIONED from MultiCast),
-                // don't request PASSTHROUGH: in BE, need_to_local_exchange sees the serial
-                // Exchange in the pipeline and skips LE insertion. Inserting PASSTHROUGH
-                // between Exchange and streaming AGG creates a pipeline split that breaks
-                // AggSink↔AggSource shared state → DCHECK/SIGSEGV crash.
+                // Only request PASSTHROUGH for serial ScanNode children (pooling scan).
+                // For other serial children (Exchange, AGG), inserting PASSTHROUGH creates
+                // a pipeline split that breaks AggSink↔AggSource shared state pairing.
                 requireChild = LocalExchangeTypeRequire.requirePassthrough();
             } else {
                 requireChild = LocalExchangeTypeRequire.noRequire();
@@ -324,9 +323,9 @@ public class AggregationNode extends PlanNode {
                     requireChild = LocalExchangeTypeRequire.noRequire();
                 } else {
                     // Serialize agg, no group key: base class → child serial → PASSTHROUGH, else NOOP
-                    // Exclude ExchangeNode children for same reason as streaming AGG above.
+                    // Only for ScanNode children (pooling scan) — same reason as above.
                     if (fragment != null && fragment.useSerialSource(connectContext)
-                            && !(children.get(0) instanceof ExchangeNode)) {
+                            && children.get(0) instanceof ScanNode) {
                         requireChild = LocalExchangeTypeRequire.requirePassthrough();
                     } else {
                         requireChild = LocalExchangeTypeRequire.noRequire();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org