This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 6b9698a248 [bugfix](insert into) should not send profile during report
process (#24127)
6b9698a248 is described below
commit 6b9698a24833d51b104247b0b85cbdb469959288
Author: yiguolei <[email protected]>
AuthorDate: Sat Sep 9 17:12:35 2023 +0800
[bugfix](insert into) should not send profile during report process (#24127)
Co-authored-by: yiguolei <[email protected]>
---
be/src/pipeline/pipeline_fragment_context.cpp | 5 +++--
be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp | 6 ++++--
be/src/runtime/plan_fragment_executor.cpp | 4 ++--
be/src/runtime/runtime_state.h | 4 +++-
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java | 8 +++++++-
gensrc/thrift/PaloInternalService.thrift | 3 +++
6 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/be/src/pipeline/pipeline_fragment_context.cpp
b/be/src/pipeline/pipeline_fragment_context.cpp
index f138d2fe4b..c66f782723 100644
--- a/be/src/pipeline/pipeline_fragment_context.cpp
+++ b/be/src/pipeline/pipeline_fragment_context.cpp
@@ -850,8 +850,9 @@ void PipelineFragmentContext::send_report(bool done) {
}
_report_status_cb(
- {exec_status, _is_report_success ?
_runtime_state->runtime_profile() : nullptr,
- _is_report_success ? _runtime_state->load_channel_profile() :
nullptr,
+ {exec_status,
+ _runtime_state->enable_profile() ?
_runtime_state->runtime_profile() : nullptr,
+ _runtime_state->enable_profile() ?
_runtime_state->load_channel_profile() : nullptr,
done || !exec_status.ok(), _query_ctx->coord_addr, _query_id,
_fragment_id,
_fragment_instance_id, _backend_num, _runtime_state.get(),
std::bind(&PipelineFragmentContext::update_status, this,
std::placeholders::_1),
diff --git a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp
b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp
index 18d69a5240..62853c0515 100644
--- a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp
+++ b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp
@@ -749,8 +749,10 @@ void PipelineXFragmentContext::send_report(bool done) {
// TODO: only send rpc once
FOR_EACH_RUNTIME_STATE(
_report_status_cb(
- {exec_status, _is_report_success ?
_runtime_state->runtime_profile() : nullptr,
- _is_report_success ?
runtime_state->load_channel_profile() : nullptr,
+ {exec_status,
+ _runtime_state->enable_profile() ?
_runtime_state->runtime_profile() : nullptr,
+ _runtime_state->enable_profile() ?
runtime_state->load_channel_profile()
+ : nullptr,
done || !exec_status.ok(), _query_ctx->coord_addr,
_query_id, _fragment_id,
runtime_state->fragment_instance_id(), _backend_num,
runtime_state.get(),
std::bind(&PipelineFragmentContext::update_status, this,
diff --git a/be/src/runtime/plan_fragment_executor.cpp
b/be/src/runtime/plan_fragment_executor.cpp
index d351ff9ca0..aafea1c422 100644
--- a/be/src/runtime/plan_fragment_executor.cpp
+++ b/be/src/runtime/plan_fragment_executor.cpp
@@ -529,8 +529,8 @@ void PlanFragmentExecutor::send_report(bool done) {
}
ReportStatusRequest report_req = {
status,
- _is_report_success ? _runtime_state->runtime_profile() : nullptr,
- _is_report_success ? _runtime_state->load_channel_profile() :
nullptr,
+ _runtime_state->enable_profile() ?
_runtime_state->runtime_profile() : nullptr,
+ _runtime_state->enable_profile() ?
_runtime_state->load_channel_profile() : nullptr,
done || !status.ok(),
_query_ctx->coord_addr,
_query_ctx->query_id(),
diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h
index 76e22fe084..94350f48fa 100644
--- a/be/src/runtime/runtime_state.h
+++ b/be/src/runtime/runtime_state.h
@@ -394,7 +394,9 @@ public:
void set_tracer(OpentelemetryTracer&& tracer) { _tracer =
std::move(tracer); }
- bool enable_profile() const { return _query_options.is_report_success; }
+ bool enable_profile() const {
+ return _query_options.__isset.enable_profile &&
_query_options.enable_profile;
+ }
bool enable_scan_node_run_serial() const {
return _query_options.__isset.enable_scan_node_run_serial &&
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 6dd2ac6811..5507df264a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -2181,7 +2181,13 @@ public class SessionVariable implements Serializable,
Writable {
tResult.setBufferPoolLimit(maxExecMemByte);
tResult.setQueryTimeout(queryTimeoutS);
- tResult.setIsReportSuccess(enableProfile);
+ tResult.setEnableProfile(enableProfile);
+ if (enableProfile) {
+ // If enable profile == true, then also set report success to true
+ // be need report success to start report thread. But it is very
tricky
+ // we should modify BE in the future.
+ tResult.setIsReportSuccess(true);
+ }
tResult.setCodegenLevel(codegenLevel);
tResult.setBeExecVersion(Config.be_exec_version);
tResult.setEnablePipelineEngine(enablePipelineEngine);
diff --git a/gensrc/thrift/PaloInternalService.thrift
b/gensrc/thrift/PaloInternalService.thrift
index 02a314f8fa..796c25c2f7 100644
--- a/gensrc/thrift/PaloInternalService.thrift
+++ b/gensrc/thrift/PaloInternalService.thrift
@@ -242,6 +242,9 @@ struct TQueryOptions {
82: optional i64 fe_process_uuid = 0;
83: optional i32 inverted_index_conjunction_opt_threshold = 1000;
+ // A seperate flag to indicate whether to enable profile, not
+ // use is_report_success any more
+ 84: optional bool enable_profile = false;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]