deardeng commented on code in PR #59814:
URL: https://github.com/apache/doris/pull/59814#discussion_r2688762867


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudTablet.java:
##########
@@ -70,31 +82,56 @@ public Multimap<Long, Long> 
getNormalReplicaBackendPathMap(String beEndpoint) th
         return backendPathMapReprocess(pathMap);
     }
 
-    @Override
-    protected boolean isLatestReplicaAndDeleteOld(Replica newReplica) {
-        boolean delete = false;
-        boolean hasBackend = false;
-        long version = newReplica.getVersion();
-        Iterator<Replica> iterator = replicas.iterator();
-        while (iterator.hasNext()) {
-            hasBackend = true;
-            Replica replica = iterator.next();
-            if (replica.getVersion() <= version) {
-                iterator.remove();
-                delete = true;
-            }
+    private boolean isLatestReplicaAndDeleteOld(Replica newReplica) {
+        if (replica == null) {
+            return true;
         }
-
-        return delete || !hasBackend;
+        if (replica.getVersion() <= newReplica.getVersion()) {

Review Comment:
   in cloud, On the cloud, there is only one replica; this function 
(isLatestReplicaAndDeleteOld) can probably be deleted.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to