Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaRise committed Mar 22, 2023
1 parent 0dea61c commit 7636279
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions dbms/src/Flash/Coprocessor/DAGRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ DAGRequest::DAGRequest(tipb::DAGRequest * dag_request_)

void DAGRequest::checkOrSetExecutorId()
{
if (isTreeBased())
if (is_tree_based)
{
// check duplicate executor_id for tree based request.
std::unordered_set<String> ids;
Expand Down Expand Up @@ -125,13 +125,13 @@ const tipb::Executor & DAGRequest::rootExecutor() const

void DAGRequest::traverse(std::function<bool(const tipb::Executor &)> && func) const
{
if likely (dag_request)
traverseExecutors(dag_request, std::move(func));
check(dag_request, "dagrequest cannot be null");
traverseExecutors(dag_request, std::move(func));
}

void DAGRequest::traverseReverse(std::function<void(const tipb::Executor &)> && func) const
{
if likely (dag_request)
traverseExecutorsReverse(dag_request, std::move(func));
check(dag_request, "dagrequest cannot be null");
traverseExecutorsReverse(dag_request, std::move(func));
}
} // namespace DB
2 changes: 1 addition & 1 deletion dbms/src/Flash/Mpp/MPPTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void MPPTask::unregisterTask()

void MPPTask::prepare(const mpp::DispatchTaskRequest & task_request)
{
auto dag_req = getDAGRequestFromStringWithRetry(task_request.encoded_plan());
dag_req = getDAGRequestFromStringWithRetry(task_request.encoded_plan());
TMTContext & tmt_context = context->getTMTContext();
/// MPP task will only use key ranges in mpp::DispatchTaskRequest::regions/mpp::DispatchTaskRequest::table_regions.
/// The ones defined in tipb::TableScan will never be used and can be removed later.
Expand Down
2 changes: 2 additions & 0 deletions dbms/src/Flash/Mpp/MPPTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class MPPTask : public std::enable_shared_from_this<MPPTask>

void initExchangeReceivers();

// To make sure dag_req is not destroyed before the mpp task ends.
tipb::DAGRequest dag_req;
mpp::TaskMeta meta;
MPPTaskId id;

Expand Down

0 comments on commit 7636279

Please sign in to comment.