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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b0d6ec  [Log] Add error msg when tablet not found (#5659)
9b0d6ec is described below

commit 9b0d6ecaf0ee4651e8e22adb9e5952186c9fe475
Author: xinghuayu007 <[email protected]>
AuthorDate: Wed Apr 21 16:37:47 2021 +0800

    [Log] Add error msg when tablet not found (#5659)
    
    Before drop a tablet, it will try to find the tablet in tablet map.
    But the tablet maybe has been not existed.
    Therefore, it is better to print the error message and error status.
---
 be/src/agent/task_worker_pool.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/be/src/agent/task_worker_pool.cpp 
b/be/src/agent/task_worker_pool.cpp
index 85cff4e..189edfc 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -419,8 +419,9 @@ void TaskWorkerPool::_drop_tablet_worker_thread_callback() {
         TStatusCode::type status_code = TStatusCode::OK;
         std::vector<string> error_msgs;
         TStatus task_status;
+        string err;
         TabletSharedPtr dropped_tablet = 
StorageEngine::instance()->tablet_manager()->get_tablet(
-                drop_tablet_req.tablet_id, drop_tablet_req.schema_hash);
+                drop_tablet_req.tablet_id, drop_tablet_req.schema_hash, &err);
         if (dropped_tablet != nullptr) {
             OLAPStatus drop_status = 
StorageEngine::instance()->tablet_manager()->drop_tablet(
                     drop_tablet_req.tablet_id, drop_tablet_req.schema_hash);
@@ -433,6 +434,9 @@ void TaskWorkerPool::_drop_tablet_worker_thread_callback() {
             
StorageEngine::instance()->txn_manager()->force_rollback_tablet_related_txns(
                     dropped_tablet->data_dir()->get_meta(), 
drop_tablet_req.tablet_id,
                     drop_tablet_req.schema_hash, dropped_tablet->tablet_uid());
+        } else {
+            status_code = TStatusCode::NOT_FOUND;
+            error_msgs.push_back(err);
         }
         task_status.__set_status_code(status_code);
         task_status.__set_error_msgs(error_msgs);

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

Reply via email to