-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[improvement](spill) spill trigger improvement #32641
[improvement](spill) spill trigger improvement #32641
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
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
@@ -48,15 +48,25 @@ Status PartitionedHashJoinSinkLocalState::open(RuntimeState* state) { | |||
RETURN_IF_ERROR(PipelineXSinkLocalState::open(state)); | |||
return _partitioner->open(state); | |||
} | |||
Status PartitionedHashJoinSinkLocalState::close(RuntimeState* state, Status exec_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 'close' can be made static [readability-convert-member-functions-to-static]
be/src/pipeline/exec/partitioned_hash_join_sink_operator.h:48:
- Status close(RuntimeState* state, Status exec_status) override;
+ static Status close(RuntimeState* state, Status exec_status) override;
_weighted_consumption = _consumption->current_value() * ratio; | ||
_weighted_limit = weighted_limit; | ||
} | ||
void get_weighted_mem_info(int64_t& weighted_limit, int64_t& weighted_consumption) { |
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_weighted_mem_info' can be made const [readability-make-member-function-const]
void get_weighted_mem_info(int64_t& weighted_limit, int64_t& weighted_consumption) { | |
void get_weighted_mem_info(int64_t& weighted_limit, int64_t& weighted_consumption) const { |
bool is_high_wartermark = false; | ||
double mem_used_ratio = 0; | ||
}; | ||
void WorkloadGroupMgr::refresh_wg_used_memory() { |
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 'refresh_wg_used_memory' can be made static [readability-convert-member-functions-to-static]
be/src/runtime/workload_group/workload_group_manager.h:56:
- void refresh_wg_used_memory();
+ static void refresh_wg_used_memory();
bool is_high_wartermark = false; | ||
double mem_used_ratio = 0; | ||
}; | ||
void WorkloadGroupMgr::refresh_wg_used_memory() { |
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: function 'refresh_wg_used_memory' exceeds recommended size/complexity thresholds [readability-function-size]
void WorkloadGroupMgr::refresh_wg_used_memory() {
^
Additional context
be/src/runtime/workload_group/workload_group_manager.cpp:146: 106 lines including whitespace and comments (threshold 80)
void WorkloadGroupMgr::refresh_wg_used_memory() {
^
be/src/vec/spill/spill_writer.cpp
Outdated
@@ -35,13 +35,19 @@ Status SpillWriter::open() { | |||
return Status::OK(); | |||
} | |||
|
|||
SpillWriter::~SpillWriter() { | |||
if (!closed_) { | |||
LOG(WARNING) << "spill writer not closed correctly:\n" << boost::stacktrace::stacktrace(); |
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.
not use this way, boost has a static global lock.
Using doris::Status wrapped error stack, you could use it.
be/src/vec/exprs/vexpr.cpp
Outdated
@@ -97,11 +97,11 @@ TExprNode create_texpr_node_from(const void* data, const PrimitiveType& type, in | |||
break; | |||
} | |||
case TYPE_DATEV2: { | |||
THROW_IF_ERROR(create_texpr_literal_node<TYPE_DATEV2>(data, &node)); | |||
THROW_IF_ERROR(create_texpr_literal_node<TYPE_DATEV2>(data, &node, precision, scale)); |
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.
These code is not related with this PR.
@@ -462,6 +472,10 @@ Status PartitionedHashJoinProbeOperatorX::open(RuntimeState* state) { | |||
Status PartitionedHashJoinProbeOperatorX::push(RuntimeState* state, vectorized::Block* input_block, | |||
bool eos) const { | |||
auto& local_state = get_local_state(state); | |||
if (!local_state._is_running) { |
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.
You could implement 2 method in parent class:
inc_running_big_mem_op_num(){
if (not add) {
get_query_ctx()->inc_running_big_mem_op_num;
not_add=true;
}
}
dec_big_mem_op_num(){
if (not_add) {
log_fatal<<} else if (!_dec) {
query_ctx->dec;
_dec=true;
}
}
then all subclass could use this method.
c893b72
to
d29b975
Compare
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
f6e85b1
to
0e279b3
Compare
run buildall |
TPC-H: Total hot run time: 38070 ms
|
TeamCity be ut coverage result: |
TPC-DS: Total hot run time: 186969 ms
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
074178e
to
e178335
Compare
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
TPC-H: Total hot run time: 38470 ms
|
TPC-DS: Total hot run time: 181926 ms
|
TeamCity be ut coverage result: |
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
e178335
to
615fff1
Compare
run buildall |
TPC-H: Total hot run time: 37958 ms
|
TPC-DS: Total hot run time: 181686 ms
|
TeamCity be ut coverage result: |
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
@@ -128,6 +129,7 @@ Status PartitionedAggSourceOperatorX::close(RuntimeState* state) { | |||
Status PartitionedAggSourceOperatorX::get_block(RuntimeState* state, vectorized::Block* block, | |||
bool* eos) { | |||
auto& local_state = get_local_state(state); | |||
local_state.inc_running_big_mem_op_num(state); |
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.
why do we need check local state's count.
Only operator is ok?
|
||
const auto min_revocable_mem_bytes = state->min_revocable_mem(); | ||
|
||
auto tg = query_ctx->workload_group(); |
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.
If tg == nullptr then return false; to avoid core when there is no workload group bind to this query. And print log in this case.
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.
do not use tg. tg is old name "task group", use wg
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
df0ddde
to
243b57b
Compare
243b57b
to
7943882
Compare
7943882
to
58807ff
Compare
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
58807ff
to
c8f6c47
Compare
run buildall |
TPC-H: Total hot run time: 37970 ms
|
TPC-DS: Total hot run time: 182069 ms
|
TeamCity be ut coverage result: |
ClickBench: Total hot run time: 29.21 s
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
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. |
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...