Coverage Report

Created: 2026-03-16 08:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/pipeline/pipeline_task.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exec/pipeline/pipeline_task.h"
19
20
#include <fmt/core.h>
21
#include <fmt/format.h>
22
#include <gen_cpp/Metrics_types.h>
23
#include <glog/logging.h>
24
25
#include <algorithm>
26
#include <memory>
27
#include <ostream>
28
#include <vector>
29
30
#include "common/logging.h"
31
#include "common/status.h"
32
#include "core/block/block.h"
33
#include "exec/operator/exchange_source_operator.h"
34
#include "exec/operator/operator.h"
35
#include "exec/operator/rec_cte_source_operator.h"
36
#include "exec/operator/scan_operator.h"
37
#include "exec/pipeline/dependency.h"
38
#include "exec/pipeline/pipeline.h"
39
#include "exec/pipeline/pipeline_fragment_context.h"
40
#include "exec/pipeline/revokable_task.h"
41
#include "exec/pipeline/task_queue.h"
42
#include "exec/pipeline/task_scheduler.h"
43
#include "exec/spill/spill_stream.h"
44
#include "runtime/descriptors.h"
45
#include "runtime/exec_env.h"
46
#include "runtime/query_context.h"
47
#include "runtime/runtime_profile.h"
48
#include "runtime/thread_context.h"
49
#include "runtime/workload_group/workload_group_manager.h"
50
#include "util/defer_op.h"
51
#include "util/mem_info.h"
52
#include "util/uid_util.h"
53
54
namespace doris {
55
class RuntimeState;
56
} // namespace doris
57
58
namespace doris {
59
#include "common/compile_check_begin.h"
60
61
PipelineTask::PipelineTask(PipelinePtr& pipeline, uint32_t task_id, RuntimeState* state,
62
                           std::shared_ptr<PipelineFragmentContext> fragment_context,
63
                           RuntimeProfile* parent_profile,
64
                           std::map<int, std::pair<std::shared_ptr<BasicSharedState>,
65
                                                   std::vector<std::shared_ptr<Dependency>>>>
66
                                   shared_state_map,
67
                           int task_idx)
68
        :
69
#ifdef BE_TEST
70
          _query_id(fragment_context ? fragment_context->get_query_id() : TUniqueId()),
71
#else
72
2.41M
          _query_id(fragment_context->get_query_id()),
73
#endif
74
2.41M
          _index(task_id),
75
2.41M
          _pipeline(pipeline),
76
2.41M
          _opened(false),
77
2.41M
          _state(state),
78
2.41M
          _fragment_context(fragment_context),
79
2.41M
          _parent_profile(parent_profile),
80
2.41M
          _operators(pipeline->operators()),
81
2.41M
          _source(_operators.front().get()),
82
2.41M
          _root(_operators.back().get()),
83
2.41M
          _sink(pipeline->sink_shared_pointer()),
84
2.41M
          _shared_state_map(std::move(shared_state_map)),
85
2.41M
          _task_idx(task_idx),
86
2.41M
          _memory_sufficient_dependency(state->get_query_ctx()->get_memory_sufficient_dependency()),
87
2.41M
          _pipeline_name(_pipeline->name()) {
88
2.41M
#ifndef BE_TEST
89
2.41M
    _query_mem_tracker = fragment_context->get_query_ctx()->query_mem_tracker();
90
2.41M
#endif
91
2.41M
    _execution_dependencies.push_back(state->get_query_ctx()->get_execution_dependency());
92
2.41M
    if (!_shared_state_map.contains(_sink->dests_id().front())) {
93
1.94M
        auto shared_state = _sink->create_shared_state();
94
1.94M
        if (shared_state) {
95
1.93M
            _sink_shared_state = shared_state;
96
1.93M
        }
97
1.94M
    }
98
2.41M
}
99
100
2.41M
PipelineTask::~PipelineTask() {
101
2.49M
    auto reset_member = [&]() {
102
2.49M
        _shared_state_map.clear();
103
2.49M
        _sink_shared_state.reset();
104
2.49M
        _op_shared_states.clear();
105
2.49M
        _sink.reset();
106
2.49M
        _operators.clear();
107
2.49M
        _block.reset();
108
2.49M
        _pipeline.reset();
109
2.49M
    };
110
// PipelineTask is also hold by task queue( https://github.com/apache/doris/pull/49753),
111
// so that it maybe the last one to be destructed.
112
// But pipeline task hold some objects, like operators, shared state, etc. So that should release
113
// memory manually.
114
2.41M
#ifndef BE_TEST
115
2.41M
    if (_query_mem_tracker) {
116
2.41M
        SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_query_mem_tracker);
117
2.41M
        reset_member();
118
2.41M
        return;
119
2.41M
    }
120
166
#endif
121
166
    reset_member();
122
166
}
123
124
Status PipelineTask::prepare(const std::vector<TScanRangeParams>& scan_range, const int sender_id,
125
2.40M
                             const TDataSink& tsink) {
126
2.40M
    DCHECK(_sink);
127
2.40M
    _init_profile();
128
2.40M
    SCOPED_TIMER(_task_profile->total_time_counter());
129
2.40M
    SCOPED_CPU_TIMER(_task_cpu_timer);
130
2.40M
    SCOPED_TIMER(_prepare_timer);
131
2.40M
    DBUG_EXECUTE_IF("fault_inject::PipelineXTask::prepare", {
132
2.40M
        Status status = Status::Error<INTERNAL_ERROR>("fault_inject pipeline_task prepare failed");
133
2.40M
        return status;
134
2.40M
    });
135
2.40M
    {
136
        // set sink local state
137
2.40M
        LocalSinkStateInfo info {_task_idx,         _task_profile.get(),
138
2.40M
                                 sender_id,         get_sink_shared_state().get(),
139
2.40M
                                 _shared_state_map, tsink};
140
2.40M
        RETURN_IF_ERROR(_sink->setup_local_state(_state, info));
141
2.40M
    }
142
143
2.40M
    _scan_ranges = scan_range;
144
2.40M
    auto* parent_profile = _state->get_sink_local_state()->operator_profile();
145
146
5.55M
    for (int op_idx = cast_set<int>(_operators.size() - 1); op_idx >= 0; op_idx--) {
147
3.14M
        auto& op = _operators[op_idx];
148
3.14M
        LocalStateInfo info {parent_profile, _scan_ranges, get_op_shared_state(op->operator_id()),
149
3.14M
                             _shared_state_map, _task_idx};
150
3.14M
        RETURN_IF_ERROR(op->setup_local_state(_state, info));
151
3.14M
        parent_profile = _state->get_local_state(op->operator_id())->operator_profile();
152
3.14M
    }
153
2.40M
    {
154
2.40M
        const auto& deps =
155
2.40M
                _state->get_local_state(_source->operator_id())->execution_dependencies();
156
2.40M
        std::unique_lock<std::mutex> lc(_dependency_lock);
157
2.40M
        std::copy(deps.begin(), deps.end(),
158
2.40M
                  std::inserter(_execution_dependencies, _execution_dependencies.end()));
159
2.40M
    }
160
2.40M
    if (auto fragment = _fragment_context.lock()) {
161
2.40M
        if (fragment->get_query_ctx()->is_cancelled()) {
162
0
            terminate();
163
0
            return fragment->get_query_ctx()->exec_status();
164
0
        }
165
18.4E
    } else {
166
18.4E
        return Status::InternalError("Fragment already finished! Query: {}", print_id(_query_id));
167
18.4E
    }
168
2.40M
    _block = doris::Block::create_unique();
169
2.40M
    return _state_transition(State::RUNNABLE);
170
2.40M
}
171
172
2.40M
Status PipelineTask::_extract_dependencies() {
173
2.40M
    std::vector<std::vector<Dependency*>> read_dependencies;
174
2.40M
    std::vector<Dependency*> write_dependencies;
175
2.40M
    std::vector<Dependency*> finish_dependencies;
176
2.40M
    read_dependencies.resize(_operators.size());
177
2.40M
    size_t i = 0;
178
3.15M
    for (auto& op : _operators) {
179
3.15M
        auto* local_state = _state->get_local_state(op->operator_id());
180
3.15M
        DCHECK(local_state);
181
3.15M
        read_dependencies[i] = local_state->dependencies();
182
3.15M
        auto* fin_dep = local_state->finishdependency();
183
3.15M
        if (fin_dep) {
184
8
            finish_dependencies.push_back(fin_dep);
185
8
        }
186
3.15M
        i++;
187
3.15M
    }
188
2.40M
    DBUG_EXECUTE_IF("fault_inject::PipelineXTask::_extract_dependencies", {
189
2.40M
        Status status = Status::Error<INTERNAL_ERROR>(
190
2.40M
                "fault_inject pipeline_task _extract_dependencies failed");
191
2.40M
        return status;
192
2.40M
    });
193
2.40M
    {
194
2.40M
        auto* local_state = _state->get_sink_local_state();
195
2.40M
        write_dependencies = local_state->dependencies();
196
2.40M
        auto* fin_dep = local_state->finishdependency();
197
2.40M
        if (fin_dep) {
198
1.00M
            finish_dependencies.push_back(fin_dep);
199
1.00M
        }
200
2.40M
    }
201
2.40M
    {
202
2.40M
        std::unique_lock<std::mutex> lc(_dependency_lock);
203
2.40M
        read_dependencies.swap(_read_dependencies);
204
2.40M
        write_dependencies.swap(_write_dependencies);
205
2.40M
        finish_dependencies.swap(_finish_dependencies);
206
2.40M
    }
207
2.40M
    return Status::OK();
208
2.40M
}
209
210
1.49M
bool PipelineTask::inject_shared_state(std::shared_ptr<BasicSharedState> shared_state) {
211
1.49M
    if (!shared_state) {
212
894k
        return false;
213
894k
    }
214
    // Shared state is created by upstream task's sink operator and shared by source operator of
215
    // this task.
216
720k
    for (auto& op : _operators) {
217
720k
        if (shared_state->related_op_ids.contains(op->operator_id())) {
218
589k
            _op_shared_states.insert({op->operator_id(), shared_state});
219
589k
            return true;
220
589k
        }
221
720k
    }
222
    // Shared state is created by the first sink operator and shared by sink operator of this task.
223
    // For example, Set operations.
224
12.6k
    if (shared_state->related_op_ids.contains(_sink->dests_id().front())) {
225
12.6k
        DCHECK_EQ(_sink_shared_state, nullptr)
226
0
                << " Sink: " << _sink->get_name() << " dest id: " << _sink->dests_id().front();
227
12.6k
        _sink_shared_state = shared_state;
228
12.6k
        return true;
229
12.6k
    }
230
18.4E
    return false;
231
11.3k
}
232
233
2.41M
void PipelineTask::_init_profile() {
234
2.41M
    _task_profile = std::make_unique<RuntimeProfile>(fmt::format("PipelineTask(index={})", _index));
235
2.41M
    _parent_profile->add_child(_task_profile.get(), true, nullptr);
236
2.41M
    _task_cpu_timer = ADD_TIMER(_task_profile, "TaskCpuTime");
237
238
2.41M
    static const char* exec_time = "ExecuteTime";
239
2.41M
    _exec_timer = ADD_TIMER(_task_profile, exec_time);
240
2.41M
    _prepare_timer = ADD_CHILD_TIMER(_task_profile, "PrepareTime", exec_time);
241
2.41M
    _open_timer = ADD_CHILD_TIMER(_task_profile, "OpenTime", exec_time);
242
2.41M
    _get_block_timer = ADD_CHILD_TIMER(_task_profile, "GetBlockTime", exec_time);
243
2.41M
    _get_block_counter = ADD_COUNTER(_task_profile, "GetBlockCounter", TUnit::UNIT);
244
2.41M
    _sink_timer = ADD_CHILD_TIMER(_task_profile, "SinkTime", exec_time);
245
2.41M
    _close_timer = ADD_CHILD_TIMER(_task_profile, "CloseTime", exec_time);
246
247
2.41M
    _wait_worker_timer = ADD_TIMER_WITH_LEVEL(_task_profile, "WaitWorkerTime", 1);
248
249
2.41M
    _schedule_counts = ADD_COUNTER(_task_profile, "NumScheduleTimes", TUnit::UNIT);
250
2.41M
    _yield_counts = ADD_COUNTER(_task_profile, "NumYieldTimes", TUnit::UNIT);
251
2.41M
    _core_change_times = ADD_COUNTER(_task_profile, "CoreChangeTimes", TUnit::UNIT);
252
2.41M
    _memory_reserve_times = ADD_COUNTER(_task_profile, "MemoryReserveTimes", TUnit::UNIT);
253
2.41M
    _memory_reserve_failed_times =
254
2.41M
            ADD_COUNTER(_task_profile, "MemoryReserveFailedTimes", TUnit::UNIT);
255
2.41M
}
256
257
2.41M
void PipelineTask::_fresh_profile_counter() {
258
2.41M
    COUNTER_SET(_schedule_counts, (int64_t)_schedule_time);
259
2.41M
    COUNTER_SET(_wait_worker_timer, (int64_t)_wait_worker_watcher.elapsed_time());
260
2.41M
}
261
262
2.40M
Status PipelineTask::_open() {
263
2.40M
    SCOPED_TIMER(_task_profile->total_time_counter());
264
2.40M
    SCOPED_CPU_TIMER(_task_cpu_timer);
265
2.40M
    SCOPED_TIMER(_open_timer);
266
2.40M
    _dry_run = _sink->should_dry_run(_state);
267
3.16M
    for (auto& o : _operators) {
268
3.16M
        RETURN_IF_ERROR(_state->get_local_state(o->operator_id())->open(_state));
269
3.16M
    }
270
2.40M
    RETURN_IF_ERROR(_state->get_sink_local_state()->open(_state));
271
2.40M
    RETURN_IF_ERROR(_extract_dependencies());
272
2.40M
    DBUG_EXECUTE_IF("fault_inject::PipelineXTask::open", {
273
2.40M
        Status status = Status::Error<INTERNAL_ERROR>("fault_inject pipeline_task open failed");
274
2.40M
        return status;
275
2.40M
    });
276
2.40M
    _opened = true;
277
2.40M
    return Status::OK();
278
2.40M
}
279
280
13.8M
Status PipelineTask::_prepare() {
281
13.8M
    SCOPED_TIMER(_task_profile->total_time_counter());
282
13.8M
    SCOPED_CPU_TIMER(_task_cpu_timer);
283
17.7M
    for (auto& o : _operators) {
284
17.7M
        RETURN_IF_ERROR(_state->get_local_state(o->operator_id())->prepare(_state));
285
17.7M
    }
286
13.8M
    RETURN_IF_ERROR(_state->get_sink_local_state()->prepare(_state));
287
13.8M
    return Status::OK();
288
13.8M
}
289
290
7.99M
bool PipelineTask::_wait_to_start() {
291
    // Before task starting, we should make sure
292
    // 1. Execution dependency is ready (which is controlled by FE 2-phase commit)
293
    // 2. Runtime filter dependencies are ready
294
    // 3. All tablets are loaded into local storage
295
7.99M
    return std::any_of(
296
7.99M
            _execution_dependencies.begin(), _execution_dependencies.end(),
297
9.40M
            [&](Dependency* dep) -> bool { return dep->is_blocked_by(shared_from_this()); });
298
7.99M
}
299
300
2.78M
bool PipelineTask::_is_pending_finish() {
301
    // Spilling may be in progress if eos is true.
302
2.78M
    return std::ranges::any_of(_finish_dependencies, [&](Dependency* dep) -> bool {
303
1.38M
        return dep->is_blocked_by(shared_from_this());
304
1.38M
    });
305
2.78M
}
306
307
8.40M
bool PipelineTask::is_blockable() const {
308
    // Before task starting, we should make sure
309
    // 1. Execution dependency is ready (which is controlled by FE 2-phase commit)
310
    // 2. Runtime filter dependencies are ready
311
    // 3. All tablets are loaded into local storage
312
313
8.40M
    if (_state->enable_fuzzy_blockable_task()) {
314
17.7k
        if ((_schedule_time + _task_idx) % 2 == 0) {
315
10.0k
            return true;
316
10.0k
        }
317
17.7k
    }
318
319
8.39M
    return std::ranges::any_of(_operators,
320
10.9M
                               [&](OperatorPtr op) -> bool { return op->is_blockable(_state); }) ||
321
8.39M
           _sink->is_blockable(_state);
322
8.40M
}
323
324
41.9M
bool PipelineTask::_is_blocked() {
325
    // `_dry_run = true` means we do not need data from source operator.
326
41.9M
    if (!_dry_run) {
327
50.2M
        for (int i = cast_set<int>(_read_dependencies.size() - 1); i >= 0; i--) {
328
            // `_read_dependencies` is organized according to operators. For each operator, running condition is met iff all dependencies are ready.
329
45.4M
            for (auto* dep : _read_dependencies[i]) {
330
45.4M
                if (dep->is_blocked_by(shared_from_this())) {
331
3.30M
                    return true;
332
3.30M
                }
333
45.4M
            }
334
            // If all dependencies are ready for this operator, we can execute this task if no datum is needed from upstream operators.
335
40.1M
            if (!_operators[i]->need_more_input_data(_state)) {
336
31.7M
                break;
337
31.7M
            }
338
40.1M
        }
339
41.8M
    }
340
38.5M
    return _memory_sufficient_dependency->is_blocked_by(shared_from_this()) ||
341
43.3M
           std::ranges::any_of(_write_dependencies, [&](Dependency* dep) -> bool {
342
43.3M
               return dep->is_blocked_by(shared_from_this());
343
43.3M
           });
344
41.9M
}
345
346
1.57M
void PipelineTask::terminate() {
347
    // We use a lock to assure all dependencies are not deconstructed here.
348
1.57M
    std::unique_lock<std::mutex> lc(_dependency_lock);
349
1.57M
    auto fragment = _fragment_context.lock();
350
1.57M
    if (!is_finalized() && fragment) {
351
57.9k
        try {
352
57.9k
            DCHECK(_wake_up_early || fragment->is_canceled());
353
57.9k
            std::ranges::for_each(_write_dependencies,
354
289k
                                  [&](Dependency* dep) { dep->set_always_ready(); });
355
57.9k
            std::ranges::for_each(_finish_dependencies,
356
57.9k
                                  [&](Dependency* dep) { dep->set_always_ready(); });
357
60.9k
            std::ranges::for_each(_read_dependencies, [&](std::vector<Dependency*>& deps) {
358
70.7k
                std::ranges::for_each(deps, [&](Dependency* dep) { dep->set_always_ready(); });
359
60.9k
            });
360
            // All `_execution_deps` will never be set blocking from ready. So we just set ready here.
361
57.9k
            std::ranges::for_each(_execution_dependencies,
362
72.8k
                                  [&](Dependency* dep) { dep->set_ready(); });
363
57.9k
            _memory_sufficient_dependency->set_ready();
364
57.9k
        } catch (const doris::Exception& e) {
365
0
            LOG(WARNING) << "Terminate failed: " << e.code() << ", " << e.to_string();
366
0
        }
367
57.9k
    }
368
1.57M
}
369
370
/**
371
 * `_eos` indicates whether the execution phase is done. `done` indicates whether we could close
372
 * this task.
373
 *
374
 * For example,
375
 * 1. if `_eos` is false which means we should continue to get next block so we cannot close (e.g.
376
 *    `done` is false)
377
 * 2. if `_eos` is true which means all blocks from source are exhausted but `_is_pending_finish()`
378
 *    is true which means we should wait for a pending dependency ready (maybe a running rpc), so we
379
 *    cannot close (e.g. `done` is false)
380
 * 3. if `_eos` is true which means all blocks from source are exhausted and `_is_pending_finish()`
381
 *    is false which means we can close immediately (e.g. `done` is true)
382
 * @param done
383
 * @return
384
 */
385
8.40M
Status PipelineTask::execute(bool* done) {
386
8.40M
    if (_exec_state != State::RUNNABLE || _blocked_dep != nullptr) [[unlikely]] {
387
#ifdef BE_TEST
388
        return Status::InternalError("Pipeline task is not runnable! Task info: {}",
389
                                     debug_string());
390
#else
391
1
        return Status::FatalError("Pipeline task is not runnable! Task info: {}", debug_string());
392
1
#endif
393
1
    }
394
395
8.40M
    auto fragment_context = _fragment_context.lock();
396
8.40M
    if (!fragment_context) {
397
0
        return Status::InternalError("Fragment already finished! Query: {}", print_id(_query_id));
398
0
    }
399
8.40M
    int64_t time_spent = 0;
400
8.40M
    ThreadCpuStopWatch cpu_time_stop_watch;
401
8.40M
    cpu_time_stop_watch.start();
402
8.40M
    SCOPED_ATTACH_TASK(_state);
403
8.40M
    Defer running_defer {[&]() {
404
8.38M
        int64_t delta_cpu_time = cpu_time_stop_watch.elapsed_time();
405
8.38M
        _task_cpu_timer->update(delta_cpu_time);
406
8.38M
        fragment_context->get_query_ctx()->resource_ctx()->cpu_context()->update_cpu_cost_ms(
407
8.38M
                delta_cpu_time);
408
409
        // If task is woke up early, we should terminate all operators, and this task could be closed immediately.
410
8.38M
        if (_wake_up_early) {
411
8.00k
            terminate();
412
8.00k
            THROW_IF_ERROR(_root->terminate(_state));
413
8.00k
            THROW_IF_ERROR(_sink->terminate(_state));
414
8.00k
            _eos = true;
415
8.00k
            *done = true;
416
8.37M
        } else if (_eos && !_spilling &&
417
8.37M
                   (fragment_context->is_canceled() || !_is_pending_finish())) {
418
2.40M
            *done = true;
419
2.40M
        }
420
8.38M
    }};
421
8.40M
    const auto query_id = _state->query_id();
422
    // If this task is already EOS and block is empty (which means we already output all blocks),
423
    // just return here.
424
8.40M
    if (_eos && !_spilling) {
425
387k
        return Status::OK();
426
387k
    }
427
    // If this task is blocked by a spilling request and waken up immediately, the spilling
428
    // dependency will not block this task and we should just run here.
429
8.01M
    if (!_block->empty()) {
430
0
        LOG(INFO) << "Query: " << print_id(query_id) << " has pending block, size: "
431
0
                  << PrettyPrinter::print_bytes(_block->allocated_bytes());
432
0
        DCHECK(_spilling);
433
0
    }
434
435
8.01M
    SCOPED_TIMER(_task_profile->total_time_counter());
436
8.01M
    SCOPED_TIMER(_exec_timer);
437
438
8.01M
    if (!_wake_up_early) {
439
8.01M
        RETURN_IF_ERROR(_prepare());
440
8.01M
    }
441
8.01M
    DBUG_EXECUTE_IF("fault_inject::PipelineXTask::execute", {
442
8.01M
        Status status = Status::Error<INTERNAL_ERROR>("fault_inject pipeline_task execute failed");
443
8.01M
        return status;
444
8.01M
    });
445
    // `_wake_up_early` must be after `_wait_to_start()`
446
8.01M
    if (_wait_to_start() || _wake_up_early) {
447
2.18M
        return Status::OK();
448
2.18M
    }
449
5.83M
    RETURN_IF_ERROR(_prepare());
450
451
    // The status must be runnable
452
5.83M
    if (!_opened && !fragment_context->is_canceled()) {
453
2.41M
        DBUG_EXECUTE_IF("PipelineTask::execute.open_sleep", {
454
2.41M
            auto required_pipeline_id =
455
2.41M
                    DebugPoints::instance()->get_debug_param_or_default<int32_t>(
456
2.41M
                            "PipelineTask::execute.open_sleep", "pipeline_id", -1);
457
2.41M
            auto required_task_id = DebugPoints::instance()->get_debug_param_or_default<int32_t>(
458
2.41M
                    "PipelineTask::execute.open_sleep", "task_id", -1);
459
2.41M
            if (required_pipeline_id == pipeline_id() && required_task_id == task_id()) {
460
2.41M
                LOG(WARNING) << "PipelineTask::execute.open_sleep sleep 5s";
461
2.41M
                sleep(5);
462
2.41M
            }
463
2.41M
        });
464
465
2.41M
        SCOPED_RAW_TIMER(&time_spent);
466
2.41M
        RETURN_IF_ERROR(_open());
467
2.41M
    }
468
469
41.9M
    while (!fragment_context->is_canceled()) {
470
41.9M
        SCOPED_RAW_TIMER(&time_spent);
471
41.9M
        Defer defer {[&]() {
472
            // If this run is pended by a spilling request, the block will be output in next run.
473
41.9M
            if (!_spilling) {
474
41.8M
                _block->clear_column_data(_root->row_desc().num_materialized_slots());
475
41.8M
            }
476
41.9M
        }};
477
        // `_wake_up_early` must be after `_is_blocked()`
478
41.9M
        if (_is_blocked() || _wake_up_early) {
479
3.33M
            return Status::OK();
480
3.33M
        }
481
482
        /// When a task is cancelled,
483
        /// its blocking state will be cleared and it will transition to a ready state (though it is not truly ready).
484
        /// Here, checking whether it is cancelled to prevent tasks in a blocking state from being re-executed.
485
38.5M
        if (fragment_context->is_canceled()) {
486
2
            break;
487
2
        }
488
489
38.5M
        if (time_spent > _exec_time_slice) {
490
81.5k
            COUNTER_UPDATE(_yield_counts, 1);
491
81.5k
            break;
492
81.5k
        }
493
38.5M
        auto* block = _block.get();
494
495
38.5M
        DBUG_EXECUTE_IF("fault_inject::PipelineXTask::executing", {
496
38.5M
            Status status =
497
38.5M
                    Status::Error<INTERNAL_ERROR>("fault_inject pipeline_task executing failed");
498
38.5M
            return status;
499
38.5M
        });
500
501
        // `_sink->is_finished(_state)` means sink operator should be finished
502
38.5M
        if (_sink->is_finished(_state)) {
503
15
            set_wake_up_early();
504
15
            return Status::OK();
505
15
        }
506
507
        // `_dry_run` means sink operator need no more data
508
38.5M
        _eos = _dry_run || _eos;
509
38.5M
        _spilling = false;
510
38.5M
        auto workload_group = _state->workload_group();
511
        // If last run is pended by a spilling request, `_block` is produced with some rows in last
512
        // run, so we will resume execution using the block.
513
38.5M
        if (!_eos && _block->empty()) {
514
38.4M
            SCOPED_TIMER(_get_block_timer);
515
38.4M
            if (_state->low_memory_mode()) {
516
8.99k
                _sink->set_low_memory_mode(_state);
517
8.99k
                _root->set_low_memory_mode(_state);
518
8.99k
            }
519
38.4M
            DEFER_RELEASE_RESERVED();
520
38.4M
            _get_block_counter->update(1);
521
38.4M
            const auto reserve_size = _root->get_reserve_mem_size(_state);
522
38.4M
            _root->reset_reserve_mem_size(_state);
523
524
38.4M
            if (workload_group &&
525
38.4M
                _state->get_query_ctx()
526
37.6M
                        ->resource_ctx()
527
37.6M
                        ->task_controller()
528
37.6M
                        ->is_enable_reserve_memory() &&
529
38.4M
                reserve_size > 0) {
530
37.5M
                if (!_try_to_reserve_memory(reserve_size, _root)) {
531
1.92k
                    continue;
532
1.92k
                }
533
37.5M
            }
534
535
38.4M
            bool eos = false;
536
38.4M
            RETURN_IF_ERROR(_root->get_block_after_projects(_state, block, &eos));
537
38.4M
            RETURN_IF_ERROR(block->check_type_and_column());
538
38.4M
            _eos = eos;
539
38.4M
        }
540
541
38.4M
        if (!_block->empty() || _eos) {
542
3.20M
            SCOPED_TIMER(_sink_timer);
543
3.20M
            Status status = Status::OK();
544
3.20M
            DEFER_RELEASE_RESERVED();
545
3.20M
            if (_state->get_query_ctx()
546
3.20M
                        ->resource_ctx()
547
3.20M
                        ->task_controller()
548
3.20M
                        ->is_enable_reserve_memory() &&
549
3.20M
                workload_group && !(_wake_up_early || _dry_run)) {
550
3.18M
                const auto sink_reserve_size = _sink->get_reserve_mem_size(_state, _eos);
551
3.18M
                if (sink_reserve_size > 0 &&
552
3.18M
                    !_try_to_reserve_memory(sink_reserve_size, _sink.get())) {
553
763
                    continue;
554
763
                }
555
3.18M
            }
556
557
3.20M
            DBUG_EXECUTE_IF("PipelineTask::execute.sink_eos_sleep", {
558
3.20M
                auto required_pipeline_id =
559
3.20M
                        DebugPoints::instance()->get_debug_param_or_default<int32_t>(
560
3.20M
                                "PipelineTask::execute.sink_eos_sleep", "pipeline_id", -1);
561
3.20M
                auto required_task_id =
562
3.20M
                        DebugPoints::instance()->get_debug_param_or_default<int32_t>(
563
3.20M
                                "PipelineTask::execute.sink_eos_sleep", "task_id", -1);
564
3.20M
                if (required_pipeline_id == pipeline_id() && required_task_id == task_id()) {
565
3.20M
                    LOG(WARNING) << "PipelineTask::execute.sink_eos_sleep sleep 10s";
566
3.20M
                    sleep(10);
567
3.20M
                }
568
3.20M
            });
569
570
3.20M
            DBUG_EXECUTE_IF("PipelineTask::execute.terminate", {
571
3.20M
                if (_eos) {
572
3.20M
                    auto required_pipeline_id =
573
3.20M
                            DebugPoints::instance()->get_debug_param_or_default<int32_t>(
574
3.20M
                                    "PipelineTask::execute.terminate", "pipeline_id", -1);
575
3.20M
                    auto required_task_id =
576
3.20M
                            DebugPoints::instance()->get_debug_param_or_default<int32_t>(
577
3.20M
                                    "PipelineTask::execute.terminate", "task_id", -1);
578
3.20M
                    auto required_fragment_id =
579
3.20M
                            DebugPoints::instance()->get_debug_param_or_default<int32_t>(
580
3.20M
                                    "PipelineTask::execute.terminate", "fragment_id", -1);
581
3.20M
                    if (required_pipeline_id == pipeline_id() && required_task_id == task_id() &&
582
3.20M
                        fragment_context->get_fragment_id() == required_fragment_id) {
583
3.20M
                        _wake_up_early = true;
584
3.20M
                        terminate();
585
3.20M
                    } else if (required_pipeline_id == pipeline_id() &&
586
3.20M
                               fragment_context->get_fragment_id() == required_fragment_id) {
587
3.20M
                        LOG(WARNING) << "PipelineTask::execute.terminate sleep 5s";
588
3.20M
                        sleep(5);
589
3.20M
                    }
590
3.20M
                }
591
3.20M
            });
592
3.20M
            RETURN_IF_ERROR(block->check_type_and_column());
593
3.20M
            status = _sink->sink(_state, block, _eos);
594
595
3.20M
            if (_eos) {
596
2.41M
                if (_sink->reset_to_rerun(_state, _root)) {
597
1.87k
                    _eos = false;
598
2.41M
                } else {
599
2.41M
                    RETURN_IF_ERROR(close(Status::OK(), false));
600
2.41M
                }
601
2.41M
            }
602
603
3.20M
            if (status.is<ErrorCode::END_OF_FILE>()) {
604
14
                set_wake_up_early();
605
14
                return Status::OK();
606
3.20M
            } else if (!status) {
607
17
                return status;
608
17
            }
609
610
3.20M
            if (_eos) { // just return, the scheduler will do finish work
611
2.41M
                return Status::OK();
612
2.41M
            }
613
3.20M
        }
614
38.4M
    }
615
616
87.3k
    RETURN_IF_ERROR(_state->get_query_ctx()->get_pipe_exec_scheduler()->submit(shared_from_this()));
617
87.3k
    return Status::OK();
618
87.3k
}
619
620
990
Status PipelineTask::do_revoke_memory(const std::shared_ptr<SpillContext>& spill_context) {
621
990
    auto fragment_context = _fragment_context.lock();
622
990
    if (!fragment_context) {
623
0
        return Status::InternalError("Fragment already finished! Query: {}", print_id(_query_id));
624
0
    }
625
626
990
    SCOPED_ATTACH_TASK(_state);
627
990
    ThreadCpuStopWatch cpu_time_stop_watch;
628
990
    cpu_time_stop_watch.start();
629
990
    Defer running_defer {[&]() {
630
990
        int64_t delta_cpu_time = cpu_time_stop_watch.elapsed_time();
631
990
        _task_cpu_timer->update(delta_cpu_time);
632
990
        fragment_context->get_query_ctx()->resource_ctx()->cpu_context()->update_cpu_cost_ms(
633
990
                delta_cpu_time);
634
635
        // If task is woke up early, we should terminate all operators, and this task could be closed immediately.
636
990
        if (_wake_up_early) {
637
0
            terminate();
638
0
            THROW_IF_ERROR(_root->terminate(_state));
639
0
            THROW_IF_ERROR(_sink->terminate(_state));
640
0
            _eos = true;
641
0
        }
642
990
    }};
643
644
990
    return _sink->revoke_memory(_state, spill_context);
645
990
}
646
647
40.4M
bool PipelineTask::_try_to_reserve_memory(const size_t reserve_size, OperatorBase* op) {
648
40.4M
    auto st = thread_context()->thread_mem_tracker_mgr->try_reserve(reserve_size);
649
    // If reserve memory failed and the query is not enable spill, just disable reserve memory(this will enable
650
    // memory hard limit check, and will cancel the query if allocate memory failed) and let it run.
651
40.4M
    if (!st.ok() && !_state->enable_spill()) {
652
2
        LOG(INFO) << print_id(_query_id) << " reserve memory failed due to " << st
653
2
                  << ", and it is not enable spill, disable reserve memory and let it run";
654
2
        _state->get_query_ctx()->resource_ctx()->task_controller()->disable_reserve_memory();
655
2
        return true;
656
2
    }
657
40.4M
    COUNTER_UPDATE(_memory_reserve_times, 1);
658
40.4M
    auto sink_revocable_mem_size = _sink->revocable_mem_size(_state);
659
40.4M
    if (st.ok() && _state->enable_force_spill() && _sink->is_spillable() &&
660
40.4M
        sink_revocable_mem_size >= SpillStream::MIN_SPILL_WRITE_BATCH_MEM) {
661
993
        st = Status(ErrorCode::QUERY_MEMORY_EXCEEDED, "Force Spill");
662
993
    }
663
40.4M
    if (!st.ok()) {
664
2.68k
        COUNTER_UPDATE(_memory_reserve_failed_times, 1);
665
2.68k
        auto debug_msg = fmt::format(
666
2.68k
                "Query: {} , try to reserve: {}, operator name: {}, operator "
667
2.68k
                "id: {}, task id: {}, root revocable mem size: {}, sink revocable mem"
668
2.68k
                "size: {}, failed: {}",
669
2.68k
                print_id(_query_id), PrettyPrinter::print_bytes(reserve_size), op->get_name(),
670
2.68k
                op->node_id(), _state->task_id(),
671
2.68k
                PrettyPrinter::print_bytes(op->revocable_mem_size(_state)),
672
2.68k
                PrettyPrinter::print_bytes(sink_revocable_mem_size), st.to_string());
673
        // PROCESS_MEMORY_EXCEEDED error msg already contains process_mem_log_str
674
2.68k
        if (!st.is<ErrorCode::PROCESS_MEMORY_EXCEEDED>()) {
675
2.68k
            debug_msg +=
676
2.68k
                    fmt::format(", debug info: {}", GlobalMemoryArbitrator::process_mem_log_str());
677
2.68k
        }
678
        // If sink has enough revocable memory, trigger revoke memory
679
2.68k
        LOG(INFO) << fmt::format(
680
2.68k
                "Query: {} sink: {}, node id: {}, task id: "
681
2.68k
                "{}, revocable mem size: {}",
682
2.68k
                print_id(_query_id), _sink->get_name(), _sink->node_id(), _state->task_id(),
683
2.68k
                PrettyPrinter::print_bytes(sink_revocable_mem_size));
684
2.68k
        ExecEnv::GetInstance()->workload_group_mgr()->add_paused_query(
685
2.68k
                _state->get_query_ctx()->resource_ctx()->shared_from_this(), reserve_size, st);
686
2.68k
        _spilling = true;
687
2.68k
        return false;
688
        // !!! Attention:
689
        // In the past, if reserve failed, not add this query to paused list, because it is very small, will not
690
        // consume a lot of memory. But need set low memory mode to indicate that the system should
691
        // not use too much memory.
692
        // But if we only set _state->get_query_ctx()->set_low_memory_mode() here, and return true, the query will
693
        // continue to run and not blocked, and this reserve maybe the last block of join sink opertorator, and it will
694
        // build hash table directly and will consume a lot of memory. So that should return false directly.
695
        // TODO: we should using a global system buffer management logic to deal with low memory mode.
696
        /**
697
        if (sink_revocable_mem_size >= SpillStream::MIN_SPILL_WRITE_BATCH_MEM) {
698
            LOG(INFO) << fmt::format(
699
                    "Query: {} sink: {}, node id: {}, task id: "
700
                    "{}, revocable mem size: {}",
701
                    print_id(_query_id), _sink->get_name(), _sink->node_id(), _state->task_id(),
702
                    PrettyPrinter::print_bytes(sink_revocable_mem_size));
703
            ExecEnv::GetInstance()->workload_group_mgr()->add_paused_query(
704
                    _state->get_query_ctx()->resource_ctx()->shared_from_this(), reserve_size, st);
705
            _spilling = true;
706
            return false;
707
        } else {
708
            _state->get_query_ctx()->set_low_memory_mode();
709
        } */
710
2.68k
    }
711
40.4M
    return true;
712
40.4M
}
713
714
1.63M
void PipelineTask::stop_if_finished() {
715
1.63M
    auto fragment = _fragment_context.lock();
716
1.63M
    if (!fragment) {
717
0
        return;
718
0
    }
719
1.63M
    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(fragment->get_query_ctx()->query_mem_tracker());
720
1.63M
    if (auto sink = _sink) {
721
1.30M
        if (sink->is_finished(_state)) {
722
3.02k
            set_wake_up_early();
723
3.02k
            terminate();
724
3.02k
        }
725
1.30M
    }
726
1.63M
}
727
728
2.40M
Status PipelineTask::finalize() {
729
2.40M
    auto fragment = _fragment_context.lock();
730
2.40M
    if (!fragment) {
731
0
        return Status::OK();
732
0
    }
733
2.40M
    SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(fragment->get_query_ctx()->query_mem_tracker());
734
2.40M
    RETURN_IF_ERROR(_state_transition(State::FINALIZED));
735
2.40M
    std::unique_lock<std::mutex> lc(_dependency_lock);
736
2.40M
    _sink_shared_state.reset();
737
2.40M
    _op_shared_states.clear();
738
2.40M
    _shared_state_map.clear();
739
2.40M
    _block.reset();
740
2.40M
    _operators.clear();
741
2.40M
    _sink.reset();
742
2.40M
    _pipeline.reset();
743
2.40M
    return Status::OK();
744
2.40M
}
745
746
4.81M
Status PipelineTask::close(Status exec_status, bool close_sink) {
747
4.81M
    int64_t close_ns = 0;
748
4.81M
    Status s;
749
4.81M
    {
750
4.81M
        SCOPED_RAW_TIMER(&close_ns);
751
4.81M
        if (close_sink) {
752
2.41M
            s = _sink->close(_state, exec_status);
753
2.41M
        }
754
6.31M
        for (auto& op : _operators) {
755
6.31M
            auto tem = op->close(_state);
756
6.31M
            if (!tem.ok() && s.ok()) {
757
9
                s = std::move(tem);
758
9
            }
759
6.31M
        }
760
4.81M
    }
761
4.82M
    if (_opened) {
762
4.82M
        COUNTER_UPDATE(_close_timer, close_ns);
763
4.82M
        COUNTER_UPDATE(_task_profile->total_time_counter(), close_ns);
764
4.82M
    }
765
766
4.81M
    if (close_sink && _opened) {
767
2.41M
        _task_profile->add_info_string("WakeUpEarly", std::to_string(_wake_up_early.load()));
768
2.41M
        _fresh_profile_counter();
769
2.41M
    }
770
771
4.81M
    if (close_sink) {
772
2.41M
        RETURN_IF_ERROR(_state_transition(State::FINISHED));
773
2.41M
    }
774
4.81M
    return s;
775
4.81M
}
776
777
54.4k
std::string PipelineTask::debug_string() {
778
54.4k
    fmt::memory_buffer debug_string_buffer;
779
780
54.4k
    fmt::format_to(debug_string_buffer, "QueryId: {}\n", print_id(_query_id));
781
54.4k
    fmt::format_to(debug_string_buffer, "InstanceId: {}\n",
782
54.4k
                   print_id(_state->fragment_instance_id()));
783
784
54.4k
    fmt::format_to(debug_string_buffer,
785
54.4k
                   "PipelineTask[id = {}, open = {}, eos = {}, state = {}, dry run = "
786
54.4k
                   "{}, _wake_up_early = {}, _wake_up_by = {}, time elapsed since last state "
787
54.4k
                   "changing = {}s, spilling = {}, is running = {}]",
788
54.4k
                   _index, _opened, _eos, _to_string(_exec_state), _dry_run, _wake_up_early.load(),
789
54.4k
                   _wake_by, _state_change_watcher.elapsed_time() / NANOS_PER_SEC, _spilling,
790
54.4k
                   is_running());
791
54.4k
    std::unique_lock<std::mutex> lc(_dependency_lock);
792
54.4k
    auto* cur_blocked_dep = _blocked_dep;
793
54.4k
    auto fragment = _fragment_context.lock();
794
54.4k
    if (is_finalized() || !fragment) {
795
2.65k
        fmt::format_to(debug_string_buffer, " pipeline name = {}", _pipeline_name);
796
2.65k
        return fmt::to_string(debug_string_buffer);
797
2.65k
    }
798
51.8k
    auto elapsed = fragment->elapsed_time() / NANOS_PER_SEC;
799
51.8k
    fmt::format_to(debug_string_buffer, " elapse time = {}s, block dependency = [{}]\n", elapsed,
800
51.8k
                   cur_blocked_dep && !is_finalized() ? cur_blocked_dep->debug_string() : "NULL");
801
802
51.8k
    if (_state && _state->local_runtime_filter_mgr()) {
803
280
        fmt::format_to(debug_string_buffer, "local_runtime_filter_mgr: [{}]\n",
804
280
                       _state->local_runtime_filter_mgr()->debug_string());
805
280
    }
806
807
51.8k
    fmt::format_to(debug_string_buffer, "operators: ");
808
103k
    for (size_t i = 0; i < _operators.size(); i++) {
809
51.8k
        fmt::format_to(debug_string_buffer, "\n{}",
810
51.8k
                       _opened && !is_finalized()
811
51.8k
                               ? _operators[i]->debug_string(_state, cast_set<int>(i))
812
51.8k
                               : _operators[i]->debug_string(cast_set<int>(i)));
813
51.8k
    }
814
51.8k
    fmt::format_to(debug_string_buffer, "\n{}\n",
815
51.8k
                   _opened && !is_finalized()
816
51.8k
                           ? _sink->debug_string(_state, cast_set<int>(_operators.size()))
817
51.8k
                           : _sink->debug_string(cast_set<int>(_operators.size())));
818
819
51.8k
    fmt::format_to(debug_string_buffer, "\nRead Dependency Information: \n");
820
821
51.8k
    size_t i = 0;
822
103k
    for (; i < _read_dependencies.size(); i++) {
823
103k
        for (size_t j = 0; j < _read_dependencies[i].size(); j++) {
824
51.6k
            fmt::format_to(debug_string_buffer, "{}. {}\n", i,
825
51.6k
                           _read_dependencies[i][j]->debug_string(cast_set<int>(i) + 1));
826
51.6k
        }
827
51.6k
    }
828
829
51.8k
    fmt::format_to(debug_string_buffer, "{}. {}\n", i,
830
51.8k
                   _memory_sufficient_dependency->debug_string(cast_set<int>(i++)));
831
832
51.8k
    fmt::format_to(debug_string_buffer, "\nWrite Dependency Information: \n");
833
103k
    for (size_t j = 0; j < _write_dependencies.size(); j++, i++) {
834
51.9k
        fmt::format_to(debug_string_buffer, "{}. {}\n", i,
835
51.9k
                       _write_dependencies[j]->debug_string(cast_set<int>(j) + 1));
836
51.9k
    }
837
838
51.8k
    fmt::format_to(debug_string_buffer, "\nExecution Dependency Information: \n");
839
155k
    for (size_t j = 0; j < _execution_dependencies.size(); j++, i++) {
840
103k
        fmt::format_to(debug_string_buffer, "{}. {}\n", i,
841
103k
                       _execution_dependencies[j]->debug_string(cast_set<int>(i) + 1));
842
103k
    }
843
844
51.8k
    fmt::format_to(debug_string_buffer, "Finish Dependency Information: \n");
845
154k
    for (size_t j = 0; j < _finish_dependencies.size(); j++, i++) {
846
103k
        fmt::format_to(debug_string_buffer, "{}. {}\n", i,
847
103k
                       _finish_dependencies[j]->debug_string(cast_set<int>(i) + 1));
848
103k
    }
849
51.8k
    return fmt::to_string(debug_string_buffer);
850
54.4k
}
851
852
37.4k
size_t PipelineTask::get_revocable_size() const {
853
37.4k
    if (!_opened || is_finalized() || _running || (_eos && !_spilling)) {
854
6.29k
        return 0;
855
6.29k
    }
856
857
31.1k
    return _sink->revocable_mem_size(_state);
858
37.4k
}
859
860
990
Status PipelineTask::revoke_memory(const std::shared_ptr<SpillContext>& spill_context) {
861
990
    DCHECK(spill_context);
862
990
    if (is_finalized()) {
863
0
        spill_context->on_task_finished();
864
0
        VLOG_DEBUG << "Query: " << print_id(_state->query_id()) << ", task: " << ((void*)this)
865
0
                   << " finalized";
866
0
        return Status::OK();
867
0
    }
868
869
990
    const auto revocable_size = _sink->revocable_mem_size(_state);
870
990
    if (revocable_size >= SpillStream::MIN_SPILL_WRITE_BATCH_MEM) {
871
990
        auto revokable_task = std::make_shared<RevokableTask>(shared_from_this(), spill_context);
872
990
        RETURN_IF_ERROR(_state->get_query_ctx()->get_pipe_exec_scheduler()->submit(revokable_task));
873
990
    } else {
874
0
        spill_context->on_task_finished();
875
0
        LOG(INFO) << "Query: " << print_id(_state->query_id()) << ", task: " << ((void*)this)
876
0
                  << " has not enough data to revoke: " << revocable_size;
877
0
    }
878
990
    return Status::OK();
879
990
}
880
881
5.90M
Status PipelineTask::wake_up(Dependency* dep, std::unique_lock<std::mutex>& /* dep_lock */) {
882
    // call by dependency
883
5.90M
    DCHECK_EQ(_blocked_dep, dep) << "dep : " << dep->debug_string(0) << "task: " << debug_string();
884
5.90M
    _blocked_dep = nullptr;
885
5.90M
    auto holder = std::dynamic_pointer_cast<PipelineTask>(shared_from_this());
886
5.90M
    RETURN_IF_ERROR(_state_transition(PipelineTask::State::RUNNABLE));
887
5.91M
    if (auto f = _fragment_context.lock(); f) {
888
5.91M
        RETURN_IF_ERROR(_state->get_query_ctx()->get_pipe_exec_scheduler()->submit(holder));
889
5.91M
    }
890
5.90M
    return Status::OK();
891
5.90M
}
892
893
18.9M
Status PipelineTask::_state_transition(State new_state) {
894
19.0M
    if (_exec_state != new_state) {
895
19.0M
        _state_change_watcher.reset();
896
19.0M
        _state_change_watcher.start();
897
19.0M
    }
898
18.9M
    _task_profile->add_info_string("TaskState", _to_string(new_state));
899
18.9M
    _task_profile->add_info_string("BlockedByDependency", _blocked_dep ? _blocked_dep->name() : "");
900
18.9M
    if (!LEGAL_STATE_TRANSITION[(int)new_state].contains(_exec_state)) {
901
17
        return Status::InternalError(
902
17
                "Task state transition from {} to {} is not allowed! Task info: {}",
903
17
                _to_string(_exec_state), _to_string(new_state), debug_string());
904
17
    }
905
18.9M
    _exec_state = new_state;
906
18.9M
    return Status::OK();
907
18.9M
}
908
909
#include "common/compile_check_end.h"
910
} // namespace doris