yiguolei commented on code in PR #41968: URL: https://github.com/apache/doris/pull/41968#discussion_r1803321780
########## be/src/vec/sink/vdata_stream_sender.cpp: ########## @@ -166,131 +166,51 @@ Status PipChannel::send_broadcast_block(std::shared_ptr<BroadcastPBlockHolder>& return Status::OK(); } -Status PipChannel::send_current_block(bool eos, Status exec_status) { - if (Channel<pipeline::ExchangeSinkLocalState>::is_local()) { - return Channel<pipeline::ExchangeSinkLocalState>::send_local_block(exec_status, eos); - } - RETURN_IF_ERROR(send_remote_block(_pblock.release(), eos, exec_status)); - return Status::OK(); -} - -template <typename Parent> -Status Channel<Parent>::send_current_block(bool eos, Status exec_status) { - // FIXME: Now, local exchange will cause the performance problem is in a multi-threaded scenario - // so this feature is turned off here by default. We need to re-examine this logic +Status PipChannel::_send_current_block(bool eos, Status exec_status) { if (is_local()) { - return send_local_block(exec_status, eos); - } - if (eos) { - RETURN_IF_ERROR(_serializer.serialize_block(_ch_cur_pb_block, 1)); + return _send_local_block(exec_status, eos); } - RETURN_IF_ERROR(send_remote_block(_ch_cur_pb_block, eos, exec_status)); - ch_roll_pb_block(); + RETURN_IF_ERROR(send_remote_block(_pblock.release(), eos, exec_status)); return Status::OK(); } template <typename Parent> -Status Channel<Parent>::send_local_block(Status exec_status, bool eos) { +Status Channel<Parent>::_send_local_block(Status exec_status, bool eos) { SCOPED_TIMER(_parent->local_send_timer()); Block block = _serializer.get_block()->to_block(); _serializer.get_block()->set_mutable_columns(block.clone_empty_columns()); - if (_recvr_is_valid()) { - if constexpr (!std::is_same_v<pipeline::ResultFileSinkLocalState, Parent>) { - COUNTER_UPDATE(_parent->local_bytes_send_counter(), block.bytes()); - COUNTER_UPDATE(_parent->local_sent_rows(), block.rows()); - COUNTER_UPDATE(_parent->blocks_sent_counter(), 1); - } - _local_recvr->add_block(&block, _parent->sender_id(), true); - if (eos) { - _local_recvr->remove_sender(_parent->sender_id(), _be_number, exec_status); - } - return Status::OK(); - } else { - _serializer.reset_block(); - return _receiver_status; + if (!block.empty() || eos) { + RETURN_IF_ERROR(send_local_block(&block, eos, true)); } + _serializer.reset_block(); Review Comment: 如果这里调用reset,那么181 行的意义是什么? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org