This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 27d88b39834 [faultinjection](test) add some fault injection in
pipeline task method
27d88b39834 is described below
commit 27d88b39834fb2283c65b0d22c0b6e2b86a39118
Author: yiguolei <[email protected]>
AuthorDate: Tue May 14 14:51:51 2024 +0800
[faultinjection](test) add some fault injection in pipeline task method
---
be/src/pipeline/pipeline_x/pipeline_x_task.cpp | 20 ++++++++++++++++++--
be/src/util/debug_points.h | 3 ++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
b/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
index af1e3912eb4..538b38401ac 100644
--- a/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
+++ b/be/src/pipeline/pipeline_x/pipeline_x_task.cpp
@@ -77,7 +77,10 @@ Status PipelineXTask::prepare(const TPipelineInstanceParams&
local_params, const
SCOPED_TIMER(_task_profile->total_time_counter());
SCOPED_CPU_TIMER(_task_cpu_timer);
SCOPED_TIMER(_prepare_timer);
-
+ DBUG_EXECUTE_IF("fault_inject::PipelineXTask::prepare", {
+ Status status = Status::Error<INTERNAL_ERROR>("fault_inject
pipeline_task prepare failed");
+ return status;
+ });
{
// set sink local state
LocalSinkStateInfo info {_task_idx,
@@ -131,6 +134,11 @@ Status PipelineXTask::_extract_dependencies() {
_finish_dependencies.push_back(fin_dep);
}
}
+ DBUG_EXECUTE_IF("fault_inject::PipelineXTask::_extract_dependencies", {
+ Status status = Status::Error<INTERNAL_ERROR>(
+ "fault_inject pipeline_task _extract_dependencies failed");
+ return status;
+ });
{
auto* local_state = _state->get_sink_local_state();
_write_dependencies = local_state->dependencies();
@@ -195,6 +203,11 @@ Status PipelineXTask::_open() {
RETURN_IF_ERROR(_state->get_sink_local_state()->open(_state));
RETURN_IF_ERROR(_extract_dependencies());
_block = doris::vectorized::Block::create_unique();
+
+ DBUG_EXECUTE_IF("fault_inject::PipelineXTask::open", {
+ Status status = Status::Error<INTERNAL_ERROR>("fault_inject
pipeline_task open failed");
+ return status;
+ });
_opened = true;
return Status::OK();
}
@@ -204,7 +217,10 @@ Status PipelineXTask::execute(bool* eos) {
SCOPED_TIMER(_exec_timer);
SCOPED_ATTACH_TASK(_state);
int64_t time_spent = 0;
-
+ DBUG_EXECUTE_IF("fault_inject::PipelineXTask::execute", {
+ Status status = Status::Error<INTERNAL_ERROR>("fault_inject
pipeline_task execute failed");
+ return status;
+ });
ThreadCpuStopWatch cpu_time_stop_watch;
cpu_time_stop_watch.start();
Defer defer {[&]() {
diff --git a/be/src/util/debug_points.h b/be/src/util/debug_points.h
index 0c1607907e6..8c1fe308012 100644
--- a/be/src/util/debug_points.h
+++ b/be/src/util/debug_points.h
@@ -32,12 +32,13 @@
#include "fmt/format.h"
// more usage can see 'util/debug_points_test.cpp'
+// using {} around code, to avoid duplicate variable name
#define DBUG_EXECUTE_IF(debug_point_name, code) \
if (UNLIKELY(config::enable_debug_points)) { \
auto dp = DebugPoints::instance()->get_debug_point(debug_point_name); \
if (dp) { \
[[maybe_unused]] auto DP_NAME = debug_point_name; \
- code; \
+ { code; } \
} \
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]