github-actions[bot] commented on code in PR #62054:
URL: https://github.com/apache/doris/pull/62054#discussion_r3032652416


##########
be/src/exec/pipeline/pipeline_fragment_context.cpp:
##########
@@ -1343,8 +1343,22 @@ Status 
PipelineFragmentContext::_create_operator(ObjectPool* pool, const TPlanNo
                                   ? 
_params.per_exch_num_senders.find(tnode.node_id)->second
                                   : 0;
         DCHECK_GT(num_senders, 0);
-        op = std::make_shared<ExchangeSourceOperatorX>(pool, tnode, 
next_operator_id(), descs,
-                                                       num_senders);
+        auto exchange_op = std::make_shared<ExchangeSourceOperatorX>(
+                pool, tnode, next_operator_id(), descs, num_senders);
+        // For non-serial BUCKET_SHUFFLE exchanges, compute destination 
instances from
+        // bucket_seq_to_instance_idx. Padding instances (not in the 
destination set)
+        // will create recvrs with 0 senders to avoid hanging.
+        if (!_params.bucket_seq_to_instance_idx.empty() &&
+            tnode.exchange_node.__isset.partition_type &&
+            tnode.exchange_node.partition_type == 
TPartitionType::BUCKET_SHFFULE_HASH_PARTITIONED &&
+            !(tnode.__isset.is_serial_operator && tnode.is_serial_operator)) {
+            std::unordered_set<int> dest_instances;
+            for (const auto& [bucket, idx] : 
_params.bucket_seq_to_instance_idx) {

Review Comment:
   `bucket_seq_to_instance_idx` stores FE fragment-instance indexes 
(`ThriftPlansBuilder.instanceToIndex()`), but later `ExchangeLocalState` checks 
this set with `info.task_idx`, which is the BE pipeline task index. In pooled 
fragments those are different once `parallel_instances > 1`, so real receiver 
tasks can be treated as padding tasks and created with `num_senders=0`. This 
makes them return EOS immediately instead of receiving remote data. The 
destination set here needs to be expressed in the same index space that 
`is_destination_instance()` will use, or the later check needs to compare 
against fragment-instance identity rather than task index.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to