-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[enhancement](group_commit): refector relay wal code #29183
Conversation
run buildall |
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.
clang-tidy made some suggestions
be/src/http/action/http_stream.cpp
Outdated
@@ -387,6 +387,66 @@ Status HttpStreamAction::_process_put(HttpRequest* http_req, | |||
return _exec_env->stream_load_executor()->execute_plan_fragment(ctx); | |||
} | |||
|
|||
Status HttpStreamAction::process_wal_relay(ExecEnv* exec_env, int64_t wal_id, std::string& sql_str, |
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.
warning: method 'process_wal_relay' can be made static [readability-convert-member-functions-to-static]
Status HttpStreamAction::process_wal_relay(ExecEnv* exec_env, int64_t wal_id, std::string& sql_str, | |
static Status HttpStreamAction::process_wal_relay(ExecEnv* exec_env, int64_t wal_id, std::string& sql_str, |
be/src/olap/wal_info.cpp
Outdated
|
||
#include "olap/wal_info.h" | ||
namespace doris { | ||
WalInfo::WalInfo(std::string wal_path, int64_t retry_num, int64_t start_time_ms, bool relaying) |
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.
warning: pass by value and use std::move [modernize-pass-by-value]
be/src/olap/wal_info.cpp:18:
- namespace doris {
+
+ #include <utility>
+ namespace doris {
be/src/olap/wal_info.cpp:20:
- : _wal_path(wal_path),
+ : _wal_path(std::move(wal_path)),
_retry_num(retry_num), | ||
_start_time_ms(start_time_ms), | ||
_relaying(relaying) {} | ||
WalInfo::~WalInfo() {} |
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.
warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
WalInfo::~WalInfo() {} | |
WalInfo::~WalInfo() = default; |
std::string WalInfo::get_wal_path() { | ||
return _wal_path; | ||
} | ||
int64_t WalInfo::get_retry_num() { |
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.
warning: method 'get_retry_num' can be made const [readability-make-member-function-const]
int64_t WalInfo::get_retry_num() { | |
int64_t WalInfo::get_retry_num() const { |
be/src/olap/wal_info.h:24:
- int64_t get_retry_num();
+ int64_t get_retry_num() const;
int64_t WalInfo::get_retry_num() { | ||
return _retry_num; | ||
} | ||
int64_t WalInfo::get_start_time_ms() { |
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.
warning: method 'get_start_time_ms' can be made const [readability-make-member-function-const]
int64_t WalInfo::get_start_time_ms() { | |
int64_t WalInfo::get_start_time_ms() const { |
be/src/olap/wal_info.h:25:
- int64_t get_start_time_ms();
+ int64_t get_start_time_ms() const;
be/src/olap/wal_info.cpp
Outdated
int64_t WalInfo::get_start_time_ms() { | ||
return _start_time_ms; | ||
} | ||
bool WalInfo::get_relaying() { |
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.
warning: method 'get_relaying' can be made const [readability-make-member-function-const]
bool WalInfo::get_relaying() { | |
bool WalInfo::get_relaying() const { |
be/src/olap/wal_info.h:27:
- bool get_relaying();
+ bool get_relaying() const;
Status _parse_wal_path(const std::string& wal, std::shared_ptr<std::pair<int64_t, std::string>>&); | ||
bool _rename_to_tmp_path(const std::string wal); | ||
Status _replay_one_txn_with_stremaload(int64_t wal_id, const std::string& wal, | ||
const std::string& label); |
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.
warning: parameter 'wal' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
const std::string& label); | |
bool _rename_to_tmp_path(std::string wal); |
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.
clang-tidy made some suggestions
be/src/olap/wal_table.h
Outdated
Status _send_request(int64_t wal_id, const std::string& wal, const std::string& label); | ||
Status _abort_txn(int64_t db_id, int64_t wal_id); | ||
Status _parse_wal_path(const std::string& wal, std::shared_ptr<std::pair<int64_t, std::string>>&); | ||
bool _rename_to_tmp_path(const std::string wal); |
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.
warning: parameter 'wal' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
bool _rename_to_tmp_path(const std::string wal); | |
bool _rename_to_tmp_path(std::string wal); |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
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.
clang-tidy made some suggestions
|
||
#include "olap/wal_info.h" | ||
namespace doris { | ||
WalInfo::WalInfo(int64_t wal_id, std::string wal_path, int64_t retry_num, int64_t start_time_ms) |
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.
warning: pass by value and use std::move [modernize-pass-by-value]
be/src/olap/wal_info.cpp:18:
- namespace doris {
+
+ #include <utility>
+ namespace doris {
be/src/olap/wal_info.cpp:21:
- _wal_path(wal_path),
+ _wal_path(std::move(wal_path)),
_retry_num(retry_num), | ||
_start_time_ms(start_time_ms) {} | ||
WalInfo::~WalInfo() {} | ||
int64_t WalInfo::get_wal_id() { |
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.
warning: method 'get_wal_id' can be made const [readability-make-member-function-const]
int64_t WalInfo::get_wal_id() { | |
int64_t WalInfo::get_wal_id() const { |
be/src/olap/wal_info.h:24:
- int64_t get_wal_id();
+ int64_t get_wal_id() const;
std::string WalInfo::get_wal_path() { | ||
return _wal_path; | ||
} | ||
int64_t WalInfo::get_retry_num() { |
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.
warning: method 'get_retry_num' can be made const [readability-make-member-function-const]
int64_t WalInfo::get_retry_num() { | |
int64_t WalInfo::get_retry_num() const { |
be/src/olap/wal_info.h:25:
- int64_t get_retry_num();
+ int64_t get_retry_num() const;
int64_t WalInfo::get_retry_num() { | ||
return _retry_num; | ||
} | ||
int64_t WalInfo::get_start_time_ms() { |
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.
warning: method 'get_start_time_ms' can be made const [readability-make-member-function-const]
int64_t WalInfo::get_start_time_ms() { | |
int64_t WalInfo::get_start_time_ms() const { |
be/src/olap/wal_info.h:26:
- int64_t get_start_time_ms();
+ int64_t get_start_time_ms() const;
@@ -164,15 +166,15 @@ Status WalManager::_init_wal_dirs_info() { | |||
&_update_wal_dirs_info_thread); | |||
} | |||
|
|||
void WalManager::add_wal_status_queue(int64_t table_id, int64_t wal_id, WAL_STATUS wal_status) { | |||
void WalManager::add_wal_status_queue(int64_t table_id, int64_t wal_id, WalStatus wal_status) { |
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.
warning: method 'add_wal_status_queue' can be made static [readability-convert-member-functions-to-static]
be/src/olap/wal_manager.h:73:
- void add_wal_status_queue(int64_t table_id, int64_t wal_id, WalStatus wal_status);
+ static void add_wal_status_queue(int64_t table_id, int64_t wal_id, WalStatus wal_status);
#else | ||
return true; | ||
#endif | ||
} | ||
|
||
Status WalTable::_abort_txn(int64_t db_id, int64_t wal_id) { | ||
Status WalTable::_try_abort_txn(int64_t db_id, int64_t wal_id) { |
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.
warning: method '_try_abort_txn' can be made static [readability-convert-member-functions-to-static]
be/src/olap/wal_table.h:53:
- Status _try_abort_txn(int64_t db_id, int64_t wal_id);
+ static Status _try_abort_txn(int64_t db_id, int64_t wal_id);
return Status::OK(); | ||
} | ||
|
||
Status WalTable::_get_wal_info(const std::string& wal, | ||
std::shared_ptr<std::pair<int64_t, std::string>>& pair) { | ||
Status WalTable::_parse_wal_path(const std::string& wal, |
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.
warning: method '_parse_wal_path' can be made static [readability-convert-member-functions-to-static]
Status WalTable::_parse_wal_path(const std::string& wal, | |
static Status WalTable::_parse_wal_path(const std::string& wal, |
evhttp_add_header(req->output_headers, HTTP_LABEL_KEY.c_str(), label.c_str()); | ||
evhttp_add_header(req->output_headers, HTTP_AUTH_CODE.c_str(), std::to_string(wal_id).c_str()); | ||
evhttp_add_header(req->output_headers, HTTP_WAL_ID_KY.c_str(), std::to_string(wal_id).c_str()); | ||
Status WalTable::_construct_sql_str(const std::string& wal, const std::string& label, |
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.
warning: method '_construct_sql_str' can be made static [readability-convert-member-functions-to-static]
Status WalTable::_construct_sql_str(const std::string& wal, const std::string& label, | |
static Status WalTable::_construct_sql_str(const std::string& wal, const std::string& label, |
return st; | ||
} | ||
|
||
Status WalTable::_replay_one_txn_with_stremaload(int64_t wal_id, const std::string& wal, |
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.
warning: method '_replay_one_txn_with_stremaload' can be made static [readability-convert-member-functions-to-static]
Status WalTable::_replay_one_txn_with_stremaload(int64_t wal_id, const std::string& wal, | |
static Status WalTable::_replay_one_txn_with_stremaload(int64_t wal_id, const std::string& wal, |
Status _abort_txn(int64_t db_id, int64_t wal_id); | ||
Status _parse_wal_path(const std::string& wal, | ||
std::shared_ptr<std::pair<int64_t, std::string>>&); | ||
Status _rename_to_tmp_path(const std::string wal); |
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.
warning: parameter 'wal' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
Status _rename_to_tmp_path(const std::string wal); | |
Status _rename_to_tmp_path(std::string wal); |
d3ea597
to
b908b34
Compare
run buildall |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
run buildall |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
TeamCity be ut coverage result: |
run buildall |
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
TeamCity be ut coverage result: |
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.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...