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 08:04:06 UTC

[GitHub] [incubator-doris] xinghuayu007 opened a new pull request #5660: [TRACE] Add trace info for drop tablet

xinghuayu007 opened a new pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660


   ## Proposed changes
   
   Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [x] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   - [ ] Code refactor (Modify the code structure, format the code, etc...)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [ ] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
   - [ ] Compiling and unit tests pass locally with my changes
   - [ ] I have added tests that prove my fix is effective or that my feature works
   - [ ] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
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


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

Posted by GitBox <gi...@apache.org>.
xinghuayu007 commented on a change in pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660#discussion_r614036150



##########
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:
       update




-- 
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


[GitHub] [incubator-doris] xinghuayu007 commented on pull request #5660: [TRACE] Add trace info for all kinds of task

Posted by GitBox <gi...@apache.org>.
xinghuayu007 commented on pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660#issuecomment-836080538


   > The default `agent_task_trace_threshold_sec` is only 2 seconds,
   > which may lead to a lot of tracing dump log.
   > 
   > Maybe we can modify the default value to a large number.
   
   `agent_task_trace_threshold_sec` is modified to 86400 seconds (one day). Anyone who wants to open trace feathure, just config it lower.


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [incubator-doris] acelyc111 commented on pull request #5660: [TRACE] Add trace info for all kinds of task

Posted by GitBox <gi...@apache.org>.
acelyc111 commented on pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660#issuecomment-836132204


   > > The default `agent_task_trace_threshold_sec` is only 2 seconds,
   > > which may lead to a lot of tracing dump log.
   > > Maybe we can modify the default value to a large number.
   > 
   > `agent_task_trace_threshold_sec` is modified to 86400 seconds (one day). Anyone who wants to open trace feathure, just config it lower.
   
   How about set default to -1 which means disable it?


-- 
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


[GitHub] [incubator-doris] xinghuayu007 commented on pull request #5660: [TRACE] Add trace info for all kinds of task

Posted by GitBox <gi...@apache.org>.
xinghuayu007 commented on pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660#issuecomment-836290567


   > > > The default `agent_task_trace_threshold_sec` is only 2 seconds,
   > > > which may lead to a lot of tracing dump log.
   > > > Maybe we can modify the default value to a large number.
   > > 
   > > 
   > > `agent_task_trace_threshold_sec` is modified to 86400 seconds (one day). Anyone who wants to open trace feathure, just config it lower.
   > 
   > How about set default to -1 which means disable it?
   
   good idea.


-- 
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


[GitHub] [incubator-doris] xinghuayu007 commented on pull request #5660: [TRACE] Add trace info for all kinds of task

Posted by GitBox <gi...@apache.org>.
xinghuayu007 commented on pull request #5660:
URL: https://github.com/apache/incubator-doris/pull/5660#issuecomment-829748624


   > The default `agent_task_trace_threshold_sec` is only 2 seconds,
   > which may lead to a lot of tracing dump log.
   > 
   > Maybe we can modify the default value to a large number.
   
   how about set to 10s?


-- 
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