-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-4.0: [Improvement](exchange) avoid random partition send empty block #58175 #58340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```cpp F20251120 11:27:16.692677 39854 sort_cursor.h:148] Check failed: !block->empty() or _is_eof 11:50:02 *** Check failure stack trace: *** 11:50:02 @ 0x55b93a57a6cf google::LogMessage::SendToLog() 11:50:02 @ 0x55b93a570ce0 google::LogMessage::Flush() 11:50:02 @ 0x55b93a5743d9 google::LogMessageFatal::~LogMessageFatal() 11:50:02 @ 0x55b937195df9 doris::vectorized::BlockSupplierSortCursorImpl::process_next() 11:50:02 @ 0x55b93717e8ca doris::vectorized::VSortedRunMerger::get_next() 11:50:02 @ 0x55b9371072ed doris::vectorized::VDataStreamRecvr::get_next() 11:50:02 @ 0x55b938c171c4 doris::pipeline::ExchangeSourceOperatorX::get_block() 11:50:02 @ 0x55b9374f73e2 doris::pipeline::OperatorXBase::get_block_after_projects() 11:50:02 @ 0x55b93a002004 doris::pipeline::PipelineTask::execute() 11:50:02 @ 0x55b93a08056e doris::pipeline::TaskScheduler::_do_work() 11:50:02 @ 0x55b924b6644e doris::ThreadPool::dispatch_thread() 11:50:02 @ 0x55b924b39d37 doris::Thread::supervise_thread() 11:50:02 @ 0x55b91f4e3d27 asan_thread_start() 11:50:02 @ 0x7f06680fa609 start_thread 11:50:02 @ 0x7f066800d133 clone 11:50:02 @ (nil) (unknown) 11:50:02 *** Query id: 1c2cff2969b746f6-9f8a203e21a8b07e *** 11:50:02 *** is nereids: 1 *** 11:50:02 *** tablet id: 0 *** 11:50:02 *** Aborted at 1763609237 (unix time) try "date -d @1763609237" if you are using GNU date *** 11:50:02 *** Current BE git commitID: 6c6fd6b467 *** 11:50:02 *** SIGABRT unknown detail explain (@0x98c3) received by PID 39107 (TID 39854 OR 0x7b035bdf4700) from PID 39107; stack trace: *** 11:50:02 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /root/doris/be/src/common/signal_handler.h:420 11:50:02 1# 0x00007F0668106420 in /lib/x86_64-linux-gnu/libpthread.so.0 11:50:02 2# raise at ../sysdeps/unix/sysv/linux/raise.c:51 11:50:02 3# abort at /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:81 11:50:02 4# 0x000055B93A57F705 in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be 11:50:02 5# 0x000055B93A570FBA in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be 11:50:02 + echo 'cp -r /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0//Cluster0/fe/log /home/work/pipline/backup_center/58002_b5ae6748c1142931e756f7ec6898b28a8308bef4_p0/fe/' 11:50:02 6# google::LogMessage::SendToLog() in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be 11:50:02 + cp -r /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0//Cluster0/fe/log /home/work/pipline/backup_center/58002_b5ae6748c1142931e756f7ec6898b28a8308bef4_p0/fe/ 11:50:02 7# google::LogMessage::Flush() in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be 11:50:02 8# google::LogMessageFatal::~LogMessageFatal() in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be 11:50:02 9# doris::vectorized::BlockSupplierSortCursorImpl::process_next() at /root/doris/be/src/vec/core/sort_cursor.h:148 11:50:02 10# doris::vectorized::VSortedRunMerger::get_next(doris::vectorized::Block*, bool*) at /root/doris/be/src/vec/runtime/vsorted_run_merger.cpp:99 11:50:02 11# doris::vectorized::VDataStreamRecvr::get_next(doris::vectorized::Block*, bool*) at /root/doris/be/src/vec/runtime/vdata_stream_recvr.cpp:508 11:50:02 12# doris::pipeline::ExchangeSourceOperatorX::get_block(doris::RuntimeState*, doris::vectorized::Block*, bool*) at /root/doris/be/src/pipeline/exec/exchange_source_operator.cpp:165 11:50:02 13# doris::pipeline::OperatorXBase::get_block_after_projects(doris::RuntimeState*, doris::vectorized::Block*, bool*) at /root/doris/be/src/pipeline/exec/operator.cpp:404 11:50:02 14# doris::pipeline::PipelineTask::execute(bool*) at /root/doris/be/src/pipeline/pipeline_task.cpp:534 11:50:02 15# doris::pipeline::TaskScheduler::_do_work(int) at /root/doris/be/src/pipeline/task_scheduler.cpp:153 11:50:02 16# doris::ThreadPool::dispatch_thread() at /root/doris/be/src/util/threadpool.cpp:621 11:50:02 17# doris::Thread::supervise_thread(void*) at /root/doris/be/src/util/thread.cpp:461 11:50:02 18# asan_thread_start(void*) in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be 11:50:02 19# start_thread at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:478 11:50:02 20# __clone at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97 ``` This pull request refactors the logic for sending data blocks to exchange channels in the `ExchangeSinkOperatorX::sink` method, improving code maintainability and reducing duplication. The main change is the introduction of a reusable lambda function to handle sending blocks to the current channel, which is now used in multiple partitioning scenarios. **Code refactoring for channel block sending logic:** * Introduced a lambda function `send_to_current_channel` that encapsulates the logic for selecting the current channel and sending a block, handling both local and remote channels, and checking for receiver EOF. **Application of the new lambda in partitioning cases:** * Replaced duplicated channel selection and block sending code in the `RANDOM` partitioning case with a call to `send_to_current_channel`, simplifying the code and ensuring consistent behavior. * Replaced duplicated channel selection and block sending code in the `HIVE_TABLE_SINK_UNPARTITIONED` partitioning case with a call to `send_to_current_channel`, further reducing code repetition.
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
yiguolei
approved these changes
Nov 26, 2025
Contributor
Author
|
PR approved by at least one committer and no changes requested. |
Contributor
Author
|
PR approved by anyone and no changes requested. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-picked from #58175