-
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
Open
Userwhite
wants to merge
47
commits into
apache:master
Choose a base branch
from
Userwhite:cherry-pick-stream-load-async
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+210
−79
Open
[Enhancement] use stream load async return to optimize the performance under high concurrency #53144
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
343f79e
Revert "[fix](stuck): revert "[feat](http): use async reply to provid…
c11fce7
fix buffer wait
81662b9
fix futrue not compile
a4191dc
fix redefinition
2b3f934
fix clang compile
429adbe
fix clang compile
c74b6d5
fix clang compile
be29a7e
reformat
31748a2
Revert "[fix](stuck): revert "[feat](http): use async reply to provid…
2c46f61
fix buffer wait
bdfa223
fix futrue not compile
77ec143
fix redefinition
2d4ff70
fix clang compile
7b3501d
fix clang compile
984fb5c
fix clang compile
11171ae
reformat
b8342c7
Merge branch 'master' into cherry-pick-stream-load-async
Userwhite 75374ad
Merge branch 'cherry-pick-stream-load-async' of github.com:Userwhite/…
5f657e5
fix be ut
05bd3ff
Merge branch 'master' into cherry-pick-stream-load-async
dataroaring 93b0928
Merge branch 'master' into cherry-pick-stream-load-async
Userwhite 6bdf507
Merge branch 'master' into cherry-pick-stream-load-async
dataroaring 5f5109c
Merge branch 'master' into cherry-pick-stream-load-async
dataroaring 8f95b4d
Merge branch 'master' into cherry-pick-stream-load-async
dataroaring 18844dc
Because stream load fragment cancel depends on the free_handler_ctx, …
a6b6114
add stack trace to locate set promise two times
f859561
fix clang format
415b38b
Merge branch 'master' of https://github.com/apache/doris into cherry-…
e1edf7e
fix clang format
254e095
fix be core
fa6e7e4
Merge branch 'master' into cherry-pick-stream-load-async
Userwhite 3cfff10
Merge branch 'master' into cherry-pick-stream-load-async
Userwhite 281504b
avoid send reply two times
Userwhite 0c3bb9f
fix clang format error
Userwhite e109eac
other http request don't need to finish reply
Userwhite 29e2fb9
fix on_free may block 10min
1873e3b
use _can_send_reply to ensure send_reply after on_chunked_data
Userwhite fc686f4
format
Userwhite 5f362ee
add stacktrace log when be block
Userwhite 58ba25f
Merge remote-tracking branch 'origin/master' into cherry-pick-stream-…
Userwhite ff59731
add prepare log
Userwhite 3395d6a
fix deadlock when fragment prepare fail
Userwhite f1b10c5
reformat
Userwhite c046f5b
Merge branch 'master' into cherry-pick-stream-load-async
Userwhite 6383de4
fix timeout
Userwhite e136c71
remove unless lock
Userwhite e3fd0ba
reformat clang
Userwhite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,12 @@ | |
|
|
||
| #include <glog/logging.h> | ||
|
|
||
| #include <future> | ||
| #include <map> | ||
| #include <memory> | ||
| #include <string> | ||
|
|
||
| #include "common/config.h" | ||
| #include "http/http_method.h" | ||
| #include "util/string_util.h" | ||
|
|
||
|
|
@@ -32,6 +34,8 @@ namespace doris { | |
|
|
||
| class HttpHandler; | ||
|
|
||
| enum SendReplyType { REPLY_SYNC = 0, REPLY_ASYNC = 1 }; | ||
|
|
||
| class HttpRequest { | ||
| public: | ||
| HttpRequest(evhttp_request* ev_req); | ||
|
|
@@ -81,7 +85,13 @@ class HttpRequest { | |
|
|
||
| const char* remote_host() const; | ||
|
|
||
| void mark_send_reply(SendReplyType type = REPLY_ASYNC) { _send_reply_type = type; } | ||
|
|
||
| void finish_send_reply(); | ||
| void wait_finish_send_reply(); | ||
|
|
||
| private: | ||
| SendReplyType _send_reply_type = REPLY_SYNC; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个初始值是不是没啥用 因为 on_header 把它改写了
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 还有其他 HttpAction 会用到,他们需要默认是 SYNC 的。 |
||
| HttpMethod _method; | ||
| std::string _uri; | ||
| std::string _raw_path; | ||
|
|
@@ -95,6 +105,10 @@ class HttpRequest { | |
|
|
||
| std::shared_ptr<void> _handler_ctx; | ||
| std::string _request_body; | ||
|
|
||
| // ensure send_reply finished | ||
| std::promise<bool> _http_reply_promise; | ||
| std::future<bool> _http_reply_futrue = _http_reply_promise.get_future(); | ||
| }; | ||
|
|
||
| } // namespace doris | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
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 的,客户端感知仍然是同步的。