-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement] use stream load async return to optimize the performance under high concurrency #53144
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
base: master
Are you sure you want to change the base?
Conversation
…e better http performance * fix some bug for partition * fix for thrift * fix the thrift exit bug * Revert "[feat](http): use async reply to provide better http performance * ensure free order * [Fix](stream-load) Fix stream load stuck under high concurrency (apache#36772) When the concurrency of streamload exceeds the number of threads in the remote scanner, streamload may get stuck. The reason is that the libevent thread blocks and waits for streamload to complete, and when there is no intersection between the tasks handled by the scanner thread and the libevent thread, it gets stuck. The solution is to convert the synchronous waiting tasks of libevent into asynchronous execution by using callbacks in the streamload executor thread. See merge request: !740" Revert commit d9e74efa762c8161a5ca3df4290bbd0ab896f1ef See merge request: !745" Revert commit 396cb2ec7e0b1a21bc0d7424c627f0d9321884bc
* fix missing ; * fix stream load block See merge request: !855
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
| } | ||
|
|
||
| int StreamLoadAction::on_header(HttpRequest* req) { | ||
| req->mark_send_reply(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这么改完之后 所有的请求都走async了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只有 StreamLoad 请求,另外只是提交 reply 是 async 的,客户端感知仍然是同步的。
| } | ||
|
|
||
| private: | ||
| SendReplyType _send_reply_type = REPLY_SYNC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个初始值是不是没啥用 因为 on_header 把它改写了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还有其他 HttpAction 会用到,他们需要默认是 SYNC 的。
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
…e better http performance * fix some bug for partition * fix for thrift * fix the thrift exit bug * Revert "[feat](http): use async reply to provide better http performance * ensure free order * [Fix](stream-load) Fix stream load stuck under high concurrency (apache#36772) When the concurrency of streamload exceeds the number of threads in the remote scanner, streamload may get stuck. The reason is that the libevent thread blocks and waits for streamload to complete, and when there is no intersection between the tasks handled by the scanner thread and the libevent thread, it gets stuck. The solution is to convert the synchronous waiting tasks of libevent into asynchronous execution by using callbacks in the streamload executor thread. See merge request: !740" Revert commit d9e74efa762c8161a5ca3df4290bbd0ab896f1ef See merge request: !745" Revert commit 396cb2ec7e0b1a21bc0d7424c627f0d9321884bc
* fix missing ; * fix stream load block See merge request: !855
TPC-DS: Total hot run time: 187939 ms |
ClickBench: Total hot run time: 27.44 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
edd050f to
fc686f4
Compare
|
run buildall |
TPC-H: Total hot run time: 35713 ms |
TPC-DS: Total hot run time: 188398 ms |
ClickBench: Total hot run time: 27.43 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
|
run buildall |
1 similar comment
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 32488 ms |
TPC-DS: Total hot run time: 173992 ms |
ClickBench: Total hot run time: 27.43 s |
What problem does this PR solve?
Issue Number: close #53139
Problem Summary:
Release note
use stream load async return to optimize the performance under high concurrency, we treat
send_replyas callback of exec_plan_framgnet .exec_fragmentof be/src/runtime/stream_load/stream_load_executor.cpp, and useis_prepare_successto ensure no dead lock.ctx-> _finish_send_replyensure send_reply only be invoke one time. becuase we can't decide if callback will send_reply again when load fail.ctx-> _can_send_replyensure send_reply only whenon_headerfail orhandlefinished, or sender will receive broken-pipe when meet data-quality errorCheck List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)