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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2df1822269 [bugfix]fix DCHECK failure in remove_all_remote_rowsets 
(#10994)
2df1822269 is described below

commit 2df182226982709d557337375f23aa95e980b187
Author: plat1ko <[email protected]>
AuthorDate: Wed Jul 20 19:06:21 2022 +0800

    [bugfix]fix DCHECK failure in remove_all_remote_rowsets (#10994)
---
 be/src/agent/task_worker_pool.cpp | 19 ++++++++++---------
 be/src/olap/tablet_manager.cpp    |  4 ++--
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/be/src/agent/task_worker_pool.cpp 
b/be/src/agent/task_worker_pool.cpp
index e3c101b11f..719ce3824d 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -437,15 +437,16 @@ void 
TaskWorkerPool::_drop_tablet_worker_thread_callback() {
                 LOG(WARNING) << "drop table failed! signature: " << 
agent_task_req.signature;
                 error_msgs.push_back("drop table failed!");
                 status_code = TStatusCode::RUNTIME_ERROR;
-            }
-            // if tablet is dropped by fe, then the related txn should also be 
removed
-            
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());
-            // We remove remote rowset directly.
-            // TODO(cyx): do remove in background
-            if (drop_tablet_req.is_drop_table_or_partition) {
-                dropped_tablet->remove_all_remote_rowsets();
+            } else {
+                // if tablet is dropped by fe, then the related txn should 
also be removed
+                
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());
+                // We remove remote rowset directly.
+                // TODO(cyx): do remove in background
+                if (drop_tablet_req.is_drop_table_or_partition) {
+                    dropped_tablet->remove_all_remote_rowsets();
+                }
             }
         } else {
             status_code = TStatusCode::NOT_FOUND;
diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp
index a081c899c5..1da11a5675 100644
--- a/be/src/olap/tablet_manager.cpp
+++ b/be/src/olap/tablet_manager.cpp
@@ -431,7 +431,7 @@ Status TabletManager::drop_tablet(TTabletId tablet_id, 
TReplicaId replica_id, bo
     std::lock_guard wrlock(shard.lock);
     if (shard.tablets_under_clone.count(tablet_id) > 0) {
         LOG(INFO) << "tablet " << tablet_id << " is under clone, skip drop 
task";
-        return Status::OK();
+        return Status::Aborted("aborted");
     }
     SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER(_mem_tracker);
     return _drop_tablet_unlocked(tablet_id, replica_id, keep_files);
@@ -456,7 +456,7 @@ Status TabletManager::_drop_tablet_unlocked(TTabletId 
tablet_id, TReplicaId repl
         LOG(WARNING) << "fail to drop tablet because replica id not match. "
                      << "tablet_id=" << tablet_id << ", replica_id=" << 
to_drop_tablet->replica_id()
                      << ", request replica_id=" << replica_id;
-        return Status::OK();
+        return Status::Aborted("aborted");
     }
 
     _remove_tablet_from_partition(to_drop_tablet);


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

Reply via email to