You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/04/15 09:10:44 UTC

[GitHub] [incubator-doris] acelyc111 commented on a change in pull request #5660: [TRACE] Add trace info for drop tablet

acelyc111 commented on a change in pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660#discussion_r613847503



##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -316,6 +316,7 @@ void TaskWorkerPool::_create_tablet_worker_thread_callback() {
         TCreateTabletReq create_tablet_req;
         {
             lock_guard<Mutex> worker_thread_lock(_worker_thread_lock);
+            TRACE("get worker thread lock");

Review comment:
       Trace is created in line 407, TRACE here has no effect

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -402,6 +404,17 @@ void TaskWorkerPool::_drop_tablet_worker_thread_callback() {
             _tasks.pop_front();
         }
 
+        scoped_refptr<Trace> trace(new Trace);
+        MonotonicStopWatch watch;
+        watch.start();
+        SCOPED_CLEANUP({
+            if (watch.elapsed_time() / 1e9 > config::agent_task_trace_threshold_sec) {
+                LOG(WARNING) << "Trace:" << std::endl << trace->DumpToString(Trace::INCLUDE_ALL);
+            }
+        });

Review comment:
       Better to define a macro for these code, it's duplicate with code in ceate tablet, and if you add more traces for other tasks, there will be manu duplicate code.

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -390,6 +391,7 @@ void TaskWorkerPool::_drop_tablet_worker_thread_callback() {
         TDropTabletReq drop_tablet_req;
         {
             lock_guard<Mutex> worker_thread_lock(_worker_thread_lock);
+            TRACE("get worker thread lock");

Review comment:
       Same as above

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -402,6 +404,17 @@ void TaskWorkerPool::_drop_tablet_worker_thread_callback() {
             _tasks.pop_front();
         }
 
+        scoped_refptr<Trace> trace(new Trace);
+        MonotonicStopWatch watch;
+        watch.start();
+        SCOPED_CLEANUP({
+            if (watch.elapsed_time() / 1e9 > config::agent_task_trace_threshold_sec) {
+                LOG(WARNING) << "Trace:" << std::endl << trace->DumpToString(Trace::INCLUDE_ALL);
+            }
+        });
+        ADOPT_TRACE(trace.get());
+        
+        TRACE("begin to drop tablet");

Review comment:
       How about add another TRACE after line 422 when tablet got?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org