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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new f158ff0ee0a [bugfix](tablet)fix the tablet will be deleted when clone 
due to concurrency #25784 (#26777)
f158ff0ee0a is described below

commit f158ff0ee0ad2fc47a59e87957a13b74cb059f61
Author: Houliang Qi <neuyi...@163.com>
AuthorDate: Fri Nov 17 10:02:20 2023 +0800

    [bugfix](tablet)fix the tablet will be deleted when clone due to 
concurrency #25784 (#26777)
---
 be/src/agent/task_worker_pool.cpp                                  | 3 ++-
 fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java   | 6 +++++-
 .../src/main/java/org/apache/doris/master/ReportHandler.java       | 7 ++++---
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/be/src/agent/task_worker_pool.cpp 
b/be/src/agent/task_worker_pool.cpp
index 24c51ad69e7..d8c4eb351cf 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -1883,9 +1883,10 @@ void CloneTaskPool::_clone_worker_thread_callback() {
             LOG_INFO("successfully clone tablet")
                     .tag("signature", agent_task_req.signature)
                     .tag("tablet_id", clone_req.tablet_id);
+            ++_s_report_version;
             finish_task_request.__set_finish_tablet_infos(tablet_infos);
         }
-
+        finish_task_request.__set_report_version(_s_report_version);
         _finish_task(finish_task_request);
         _remove_task_info(agent_task_req.task_type, agent_task_req.signature);
     }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java 
b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java
index 2833eff5f3d..8efbf46b13e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java
@@ -510,7 +510,11 @@ public class MasterImpl {
         } else {
             LOG.warn("invalid clone task, ignore it. {}", task);
         }
-
+        if (request.isSetReportVersion()) {
+            long reportVersion = request.getReportVersion();
+            Env.getCurrentSystemInfo().updateBackendReportVersion(
+                    task.getBackendId(), reportVersion, task.getDbId(), 
task.getTableId());
+        }
         AgentTaskQueue.removeTask(task.getBackendId(), TTaskType.CLONE, 
task.getSignature());
     }
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
index 30c3bba3de0..7727bad0293 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
@@ -770,6 +770,10 @@ public class ReportHandler extends Daemon {
                         continue;
                     }
 
+                    BinlogConfig binlogConfig = new 
BinlogConfig(olapTable.getBinlogConfig());
+
+                    ReplicaState state = replica.getState();
+
                     // check report version again
                     long currentBackendReportVersion = 
Env.getCurrentSystemInfo()
                             .getBackendReportVersion(backendId);
@@ -777,9 +781,6 @@ public class ReportHandler extends Daemon {
                         continue;
                     }
 
-                    BinlogConfig binlogConfig = new 
BinlogConfig(olapTable.getBinlogConfig());
-
-                    ReplicaState state = replica.getState();
                     if (state == ReplicaState.NORMAL || state == 
ReplicaState.SCHEMA_CHANGE) {
                         // if state is PENDING / ROLLUP / CLONE
                         // it's normal that the replica is not created in BE 
but exists in meta.


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

Reply via email to