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 2019/09/25 15:05:18 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #1872: Check transaction_id in TClearTransactionTaskRequest

morningman commented on a change in pull request #1872: Check transaction_id in TClearTransactionTaskRequest
URL: https://github.com/apache/incubator-doris/pull/1872#discussion_r328177927
 
 

 ##########
 File path: be/src/agent/task_worker_pool.cpp
 ##########
 @@ -960,10 +960,15 @@ void* TaskWorkerPool::_clear_transaction_task_worker_thread_callback(void* arg_t
         vector<string> error_msgs;
         TStatus task_status;
 
-        worker_pool_this->_env->storage_engine()->clear_transaction_task(
-            clear_transaction_task_req.transaction_id, clear_transaction_task_req.partition_id);
-        LOG(INFO) << "finish to clear transaction task. signature:" << agent_task_req.signature
-                  << ", transaction_id:" << clear_transaction_task_req.transaction_id;
+        if (clear_transaction_task_req.transaction_id > 0) {
+            // transaction_id should be greater than zero.
+            // If it is not greater than zero, no need to execute
+            // the following clear_transaction_task() function.
+            worker_pool_this->_env->storage_engine()->clear_transaction_task(
+                    clear_transaction_task_req.transaction_id, clear_transaction_task_req.partition_id);
+            LOG(INFO) << "finish to clear transaction task. signature:" << agent_task_req.signature
+                      << ", transaction_id:" << clear_transaction_task_req.transaction_id;
+        }
 
 Review comment:
   I think we should add an `else` block to print warning log if transaction id < 0.
   This still a bug.

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


With regards,
Apache Git Services

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