This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 47989c0045 [fix](load) load core dump print load id (#22388) (#22440)
47989c0045 is described below

commit 47989c0045006e5682b5277b0544ead3468642f6
Author: Xinyi Zou <[email protected]>
AuthorDate: Tue Aug 1 19:11:27 2023 +0800

    [fix](load) load core dump print load id (#22388) (#22440)
    
    save the load id to the thread context,
    expect all task ids to be saved in thread context, compaction/schema 
change/etc.
---
 be/src/common/signal_handler.h      | 10 ++++++++++
 be/src/runtime/thread_context.cpp   |  3 +--
 be/src/service/internal_service.cpp |  4 ++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/be/src/common/signal_handler.h b/be/src/common/signal_handler.h
index a89451e03d..629d8e0a82 100644
--- a/be/src/common/signal_handler.h
+++ b/be/src/common/signal_handler.h
@@ -429,6 +429,16 @@ void FailureSignalHandler(int signal_number, siginfo_t* 
signal_info, void* ucont
 
 } // namespace
 
+inline void set_signal_task_id(PUniqueId tid) {
+    query_id_hi = tid.hi();
+    query_id_lo = tid.lo();
+}
+
+inline void set_signal_task_id(TUniqueId tid) {
+    query_id_hi = tid.hi;
+    query_id_lo = tid.lo;
+}
+
 inline void InstallFailureSignalHandler() {
     // Build the sigaction struct.
     struct sigaction sig_action;
diff --git a/be/src/runtime/thread_context.cpp 
b/be/src/runtime/thread_context.cpp
index 71957c366b..3710672791 100644
--- a/be/src/runtime/thread_context.cpp
+++ b/be/src/runtime/thread_context.cpp
@@ -46,8 +46,7 @@ AttachTask::AttachTask(const 
std::shared_ptr<MemTrackerLimiter>& mem_tracker,
 
 AttachTask::AttachTask(RuntimeState* runtime_state) {
     SwitchBthreadLocal::switch_to_bthread_local();
-    doris::signal::query_id_hi = runtime_state->query_id().hi;
-    doris::signal::query_id_lo = runtime_state->query_id().lo;
+    signal::set_signal_task_id(runtime_state->query_id());
     thread_context()->attach_task(print_id(runtime_state->query_id()),
                                   runtime_state->fragment_instance_id(),
                                   runtime_state->query_mem_tracker());
diff --git a/be/src/service/internal_service.cpp 
b/be/src/service/internal_service.cpp
index 075a47847e..9a94b3466b 100644
--- a/be/src/service/internal_service.cpp
+++ b/be/src/service/internal_service.cpp
@@ -22,6 +22,7 @@
 #include <string>
 
 #include "common/config.h"
+#include "common/signal_handler.h"
 #include "gen_cpp/BackendService.h"
 #include "gen_cpp/internal_service.pb.h"
 #include "http/http_client.h"
@@ -207,6 +208,7 @@ void 
PInternalServiceImpl::tablet_writer_open(google::protobuf::RpcController* c
     bool ret = _light_work_pool.try_offer([this, request, response, done]() {
         VLOG_RPC << "tablet writer open, id=" << request->id()
                  << ", index_id=" << request->index_id() << ", txn_id=" << 
request->txn_id();
+        signal::set_signal_task_id(request->id());
         brpc::ClosureGuard closure_guard(done);
         auto st = _exec_env->load_channel_mgr()->open(*request);
         if (!st.ok()) {
@@ -345,6 +347,7 @@ void 
PInternalServiceImpl::_tablet_writer_add_block(google::protobuf::RpcControl
         int64_t execution_time_ns = 0;
         {
             SCOPED_RAW_TIMER(&execution_time_ns);
+            signal::set_signal_task_id(request->id());
             auto st = _exec_env->load_channel_mgr()->add_batch(*request, 
response);
             if (!st.ok()) {
                 LOG(WARNING) << "tablet writer add block failed, message=" << 
st
@@ -438,6 +441,7 @@ void 
PInternalServiceImpl::tablet_writer_cancel(google::protobuf::RpcController*
     bool ret = _light_work_pool.try_offer([this, request, done]() {
         VLOG_RPC << "tablet writer cancel, id=" << request->id()
                  << ", index_id=" << request->index_id() << ", sender_id=" << 
request->sender_id();
+        signal::set_signal_task_id(request->id());
         brpc::ClosureGuard closure_guard(done);
         auto st = _exec_env->load_channel_mgr()->cancel(*request);
         if (!st.ok()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to