Copilot commented on code in PR #59934:
URL: https://github.com/apache/doris/pull/59934#discussion_r2694285794


##########
fe/fe-core/src/main/java/org/apache/doris/cloud/catalog/CloudTablet.java:
##########
@@ -82,33 +83,59 @@ public Multimap<Long, Long> 
getNormalReplicaBackendPathMap(String beEndpoint) th
         return backendPathMapReprocess(pathMap);
     }
 
-    private boolean isLatestReplicaAndDeleteOld(Replica newReplica) {
+    @Override
+    public void addReplica(Replica replica, boolean isRestore) {
+        this.replica = replica;
+        if (!isRestore) {
+            Env.getCurrentInvertedIndex().addReplica(id, replica);
+        }
+    }

Review Comment:
   The version checking logic in `isLatestReplicaAndDeleteOld` has been removed 
from the `addReplica` method. Previously, the code would only update the 
replica if the new replica's version was greater than or equal to the existing 
replica's version. Now it unconditionally replaces the replica. This behavior 
change could potentially allow an older-versioned replica to replace a newer 
one. If this change is intentional due to different version handling in the 
cloud implementation, it should be documented. Otherwise, the version checking 
logic should be preserved.



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