From bb1a472b0d237ef12b6864418adaa87e140d8a41 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Thu, 18 May 2023 15:47:01 +0800 Subject: [PATCH 1/2] init --- dbms/src/Flash/Mpp/AsyncRequestHandler.h | 2 +- dbms/src/Flash/Mpp/ExchangeReceiver.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dbms/src/Flash/Mpp/AsyncRequestHandler.h b/dbms/src/Flash/Mpp/AsyncRequestHandler.h index f13a831074e..fb86efbe476 100644 --- a/dbms/src/Flash/Mpp/AsyncRequestHandler.h +++ b/dbms/src/Flash/Mpp/AsyncRequestHandler.h @@ -79,7 +79,7 @@ class AsyncRequestHandler : public AsyncRequestHandlerBase : cq(&(GRPCCompletionQueuePool::global_instance->pickQueue())) , rpc_context(context) , request(std::move(req)) - , req_info(fmt::format("tunnel{}+{}", req.send_task_id, req.recv_task_id)) + , req_info(fmt::format("async tunnel{}+{}", req.send_task_id, req.recv_task_id)) , has_data(false) , retry_times(0) , stage(AsyncRequestStage::NEED_INIT) diff --git a/dbms/src/Flash/Mpp/ExchangeReceiver.cpp b/dbms/src/Flash/Mpp/ExchangeReceiver.cpp index af991163d35..1ea6a91d9b8 100644 --- a/dbms/src/Flash/Mpp/ExchangeReceiver.cpp +++ b/dbms/src/Flash/Mpp/ExchangeReceiver.cpp @@ -590,12 +590,13 @@ void ExchangeReceiverBase::setUpLocalConnections(std::vectoridentifier(), req_info)); LocalRequestHandler local_request_handler( getMemoryTracker(), - [this](bool meet_error, const String & local_err_msg) { - this->connectionDone(meet_error, local_err_msg, exc_log); + [this, log = local_log](bool meet_error, const String & local_err_msg) { + this->connectionDone(meet_error, local_err_msg, log); }, [this]() { this->connectionLocalDone(); @@ -603,7 +604,7 @@ void ExchangeReceiverBase::setUpLocalConnections(std::vectoraddLocalConnectionNum(); }, - ReceiverChannelWriter(&(getMsgChannels()), req_info, exc_log, getDataSizeInQueue(), ReceiverMode::Local)); + ReceiverChannelWriter(&(getMsgChannels()), req_info, local_log, getDataSizeInQueue(), ReceiverMode::Local)); rpc_context->establishMPPConnectionLocalV2( req, From 2b61d10e94e0e2d78a00abaac1eb8562aefbc1b3 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Thu, 18 May 2023 15:58:40 +0800 Subject: [PATCH 2/2] add --- dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp | 5 ++--- dbms/src/Flash/Pipeline/Schedule/Tasks/Task.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp b/dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp index 417cbb75e07..0aef549ed9c 100644 --- a/dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp +++ b/dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp @@ -212,9 +212,8 @@ void Event::switchStatus(EventStatus from, EventStatus to) magic_enum::enum_name(from), magic_enum::enum_name(to), magic_enum::enum_name(status.load())); -#ifndef NDEBUG - LOG_TRACE(log, "switch status: {} --> {}", magic_enum::enum_name(from), magic_enum::enum_name(to)); -#endif // !NDEBUG + + LOG_DEBUG(log, "switch status: {} --> {}", magic_enum::enum_name(from), magic_enum::enum_name(to)); } void Event::assertStatus(EventStatus expect) diff --git a/dbms/src/Flash/Pipeline/Schedule/Tasks/Task.cpp b/dbms/src/Flash/Pipeline/Schedule/Tasks/Task.cpp index c7167400d47..a22d721d965 100644 --- a/dbms/src/Flash/Pipeline/Schedule/Tasks/Task.cpp +++ b/dbms/src/Flash/Pipeline/Schedule/Tasks/Task.cpp @@ -77,12 +77,14 @@ Task::Task(MemoryTrackerPtr mem_tracker_, const String & req_id) Task::~Task() { - RUNTIME_ASSERT( - task_status == ExecTaskStatus::FINALIZE, - log, - "The state of the Task must be {} before it is destructed, but it is actually {}", - magic_enum::enum_name(ExecTaskStatus::FINALIZE), - magic_enum::enum_name(task_status)); + if unlikely (task_status != ExecTaskStatus::FINALIZE) + { + LOG_WARNING( + log, + "The state of the Task should be {} before it is destructed, but it is actually {}", + magic_enum::enum_name(ExecTaskStatus::FINALIZE), + magic_enum::enum_name(task_status)); + } } #define CHECK_FINISHED \