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/11/11 14:56:07 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #6063: [Bug]Fix the bug data balance causes tablet loss

morningman commented on a change in pull request #6063:
URL: https://github.com/apache/incubator-doris/pull/6063#discussion_r747556023



##########
File path: gensrc/thrift/AgentService.thrift
##########
@@ -85,11 +85,14 @@ struct TCreateTabletReq {
     12: optional bool is_eco_mode
     13: optional TStorageFormat storage_format
     14: optional TTabletType tablet_type
+    15: optional Types.TReplicaId replica_id
+    16: optional Types.TReplicaId base_replica_id

Review comment:
       Add comment to explain `replica_id` and `base_replica_id`

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -901,6 +910,14 @@ void TaskWorkerPool::_clone_worker_thread_callback() {
         DorisMetrics::instance()->clone_requests_total->increment(1);
         LOG(INFO) << "get clone task. signature:" << agent_task_req.signature;
 
+        TReplicaId replica_id = clone_req.__isset.replica_id ? clone_req.replica_id : 0;
+        // check tablet with the same tabletId existance, if exist, set tablet in clone mode
+        TabletSharedPtr exist_tablet = StorageEngine::instance()->tablet_manager()->get_tablet(

Review comment:
       I think we can do this in `EngineCloneTask`.

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -425,11 +427,18 @@ void TaskWorkerPool::_drop_tablet_worker_thread_callback() {
         std::vector<string> error_msgs;
         TStatus task_status;
         string err;
+        TReplicaId replica_id = drop_tablet_req.__isset.replica_id ? drop_tablet_req.replica_id : 0;
         TabletSharedPtr dropped_tablet = StorageEngine::instance()->tablet_manager()->get_tablet(
-                drop_tablet_req.tablet_id, drop_tablet_req.schema_hash, false, &err);
+                drop_tablet_req.tablet_id, drop_tablet_req.schema_hash, replica_id, false, &err);
         if (dropped_tablet != nullptr) {
+            if (dropped_tablet->clone_mode()) {

Review comment:
       Why not just do this check in `tablet_manager()->drop_tablet`?

##########
File path: be/src/agent/task_worker_pool.cpp
##########
@@ -928,6 +945,14 @@ void TaskWorkerPool::_clone_worker_thread_callback() {
         task_status.__set_error_msgs(error_msgs);
         finish_task_request.__set_task_status(task_status);
 
+        // clone done, set clone mode false

Review comment:
       Do this in clone task.




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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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