Gabriel39 commented on code in PR #36202:
URL: https://github.com/apache/doris/pull/36202#discussion_r1639197849
##########
be/src/pipeline/local_exchange/local_exchanger.cpp:
##########
@@ -302,24 +302,15 @@ Status
LocalMergeSortExchanger::build_merger(RuntimeState* state,
vectorized::BlockSupplier block_supplier = [&, id =
channel_id](vectorized::Block* block,
bool*
eos) {
vectorized::Block next_block;
- if (_running_sink_operators == 0) {
- if (_data_queue[id].try_dequeue(next_block)) {
- block->swap(next_block);
- if (_free_block_limit == 0 ||
- _free_blocks.size_approx() < _free_block_limit *
_num_sources) {
- _free_blocks.enqueue(std::move(next_block));
- }
- sub_mem_usage(local_state, id, block->allocated_bytes());
- } else {
- *eos = true;
- }
- } else if (_data_queue[id].try_dequeue(next_block)) {
+ if (_data_queue[id].try_dequeue(next_block)) {
Review Comment:
Consider events below:
1. `_data_queue[id].try_dequeue(next_block)` return false which means no
data in this queue
2. Another block is push into `_data_queue[id]` and sub
`_running_sink_operators` to 0.
3. `_running_sink_operators == 0` is true and set eos to true.
And then the result is wrong
--
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]