Skip to content
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](runtime-filter) enlarge merge_filter_callback timeout_m… #42602 #44593

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ DEFINE_mInt32(streaming_load_rpc_max_alive_time_sec, "1200");
DEFINE_Int32(tablet_writer_open_rpc_timeout_sec, "60");
// You can ignore brpc error '[E1011]The server is overcrowded' when writing data.
DEFINE_mBool(tablet_writer_ignore_eovercrowded, "true");
DEFINE_mBool(exchange_sink_ignore_eovercrowded, "true");
DEFINE_mInt32(slave_replica_writer_rpc_timeout_sec, "60");
// Whether to enable stream load record function, the default is false.
// False: disable stream load record
Expand Down Expand Up @@ -927,7 +926,8 @@ DEFINE_mInt64(small_column_size_buffer, "100");

// rf will decide whether the next sampling_frequency blocks need to be filtered based on the filtering rate of the current block.
DEFINE_mInt32(runtime_filter_sampling_frequency, "64");

DEFINE_mInt32(execution_max_rpc_timeout_sec, "3600");
DEFINE_mBool(execution_ignore_eovercrowded, "true");
// cooldown task configs
DEFINE_Int32(cooldown_thread_num, "5");
DEFINE_mInt64(generate_cooldown_task_interval_sec, "20");
Expand Down
3 changes: 2 additions & 1 deletion be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ DECLARE_mInt32(streaming_load_rpc_max_alive_time_sec);
DECLARE_Int32(tablet_writer_open_rpc_timeout_sec);
// You can ignore brpc error '[E1011]The server is overcrowded' when writing data.
DECLARE_mBool(tablet_writer_ignore_eovercrowded);
DECLARE_mBool(exchange_sink_ignore_eovercrowded);
DECLARE_mInt32(slave_replica_writer_rpc_timeout_sec);
// Whether to enable stream load record function, the default is false.
// False: disable stream load record
Expand Down Expand Up @@ -977,6 +976,8 @@ DECLARE_mInt64(big_column_size_buffer);
DECLARE_mInt64(small_column_size_buffer);

DECLARE_mInt32(runtime_filter_sampling_frequency);
DECLARE_mInt32(execution_max_rpc_timeout_sec);
DECLARE_mBool(execution_ignore_eovercrowded);

// cooldown task configs
DECLARE_Int32(cooldown_thread_num);
Expand Down
13 changes: 11 additions & 2 deletions be/src/exprs/runtime_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,11 @@ Status IRuntimeFilter::send_filter_size(RuntimeState* state, uint64_t local_filt

request->set_filter_size(local_filter_size);
request->set_filter_id(_filter_id);
callback->cntl_->set_timeout_ms(std::min(3600, state->execution_timeout()) * 1000);

callback->cntl_->set_timeout_ms(get_execution_rpc_timeout_ms(state->execution_timeout()));
if (config::execution_ignore_eovercrowded) {
callback->cntl_->ignore_eovercrowded();
}

stub->send_filter_size(closure->cntl_.get(), closure->request_.get(), closure->response_.get(),
closure.get());
Expand Down Expand Up @@ -1196,7 +1200,12 @@ Status IRuntimeFilter::push_to_remote(const TNetworkAddress* addr, uint64_t loca
merge_filter_request->set_local_merge_time(local_merge_time);
auto column_type = _wrapper->column_type();
RETURN_IF_CATCH_EXCEPTION(merge_filter_request->set_column_type(to_proto(column_type)));
merge_filter_callback->cntl_->set_timeout_ms(_state->get_query_ctx()->execution_timeout());

merge_filter_callback->cntl_->set_timeout_ms(
get_execution_rpc_timeout_ms(_state->get_query_ctx()->execution_timeout()));
if (config::execution_ignore_eovercrowded) {
merge_filter_callback->cntl_->ignore_eovercrowded();
}

if (get_ignored()) {
merge_filter_request->set_filter_type(PFilterType::UNKNOW_FILTER);
Expand Down
4 changes: 2 additions & 2 deletions be/src/pipeline/exec/exchange_sink_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
auto send_callback = request.channel->get_send_callback(id, request.eos);

send_callback->cntl_->set_timeout_ms(request.channel->_brpc_timeout_ms);
if (config::exchange_sink_ignore_eovercrowded) {
if (config::execution_ignore_eovercrowded) {
send_callback->cntl_->ignore_eovercrowded();
}
send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
Expand Down Expand Up @@ -309,7 +309,7 @@ Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
}
auto send_callback = request.channel->get_send_callback(id, request.eos);
send_callback->cntl_->set_timeout_ms(request.channel->_brpc_timeout_ms);
if (config::exchange_sink_ignore_eovercrowded) {
if (config::execution_ignore_eovercrowded) {
send_callback->cntl_->ignore_eovercrowded();
}
send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
Expand Down
13 changes: 11 additions & 2 deletions be/src/runtime/runtime_filter_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <string>
#include <utility>

#include "common/config.h"
#include "common/logging.h"
#include "common/status.h"
#include "exprs/bloom_filter_func.h"
Expand Down Expand Up @@ -344,7 +345,10 @@ Status RuntimeFilterMergeControllerEntity::send_filter_size(const PSendFilterSiz
pquery_id->set_hi(_state->get_query_ctx()->query_id().hi);
pquery_id->set_lo(_state->get_query_ctx()->query_id().lo);
closure->cntl_->set_timeout_ms(
std::min(3600, _state->get_query_ctx()->execution_timeout()) * 1000);
get_execution_rpc_timeout_ms(_state->get_query_ctx()->execution_timeout()));
if (config::execution_ignore_eovercrowded) {
closure->cntl_->ignore_eovercrowded();
}

closure->request_->set_filter_id(filter_id);
closure->request_->set_filter_size(cnt_val->global_size);
Expand Down Expand Up @@ -453,8 +457,13 @@ Status RuntimeFilterMergeControllerEntity::merge(const PMergeFilterRequest* requ
if (has_attachment) {
closure->cntl_->request_attachment().append(request_attachment);
}

closure->cntl_->set_timeout_ms(
std::min(3600, _state->get_query_ctx()->execution_timeout()) * 1000);
get_execution_rpc_timeout_ms(_state->get_query_ctx()->execution_timeout()));
if (config::execution_ignore_eovercrowded) {
closure->cntl_->ignore_eovercrowded();
}

// set fragment-id
if (target.__isset.target_fragment_ids) {
for (auto& target_fragment_id : target.target_fragment_ids) {
Expand Down
5 changes: 5 additions & 0 deletions be/src/runtime/runtime_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "agent/be_exec_version_manager.h"
#include "cctz/time_zone.h"
#include "common/compiler_util.h" // IWYU pragma: keep
#include "common/config.h"
#include "common/factory_creator.h"
#include "common/status.h"
#include "gutil/integral_types.h"
Expand All @@ -51,6 +52,10 @@
namespace doris {
class IRuntimeFilter;

inline int32_t get_execution_rpc_timeout_ms(int32_t execution_timeout_sec) {
return std::min(config::execution_max_rpc_timeout_sec, execution_timeout_sec) * 1000;
}

namespace pipeline {
class PipelineXLocalStateBase;
class PipelineXSinkLocalStateBase;
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/sink/vdata_stream_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Status Channel::open(RuntimeState* state) {
}
_be_number = state->be_number();

_brpc_timeout_ms = std::min(3600, state->execution_timeout()) * 1000;
_brpc_timeout_ms = get_execution_rpc_timeout_ms(state->execution_timeout());

_serializer.set_is_local(_is_local);

Expand Down
Loading