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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java:
##########
@@ -231,6 +232,10 @@ public List<Replica> getQueryableReplicas(long 
visibleVersion, Map<Long, Set<Lon
                 notCatchupReplica.add(replica);
                 continue;
             }
+            if (replica.isUserDrop()) {
+                userDropReplica.add(replica);
+                continue;
+            }

Review Comment:
   The new behavior for filtering user-dropped replicas lacks test coverage. 
The existing test file `QueryTabletTest.java` tests other replica filtering 
scenarios (bad disks, lost disks), but there's no test case for user-dropped 
replicas. Consider adding a test case that verifies user-dropped replicas are 
deprioritized and only selected as a last resort when no other replicas are 
available.



##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java:
##########
@@ -231,6 +232,10 @@ public List<Replica> getQueryableReplicas(long 
visibleVersion, Map<Long, Set<Lon
                 notCatchupReplica.add(replica);
                 continue;
             }
+            if (replica.isUserDrop()) {
+                userDropReplica.add(replica);
+                continue;
+            }

Review Comment:
   The user-drop check is placed after the version catchup check, which creates 
an inconsistent priority hierarchy. A user-dropped replica that hasn't caught 
up with the version will be added to `notCatchupReplica` (fallback priority 5), 
while a user-dropped replica that has caught up will be added to 
`userDropReplica` (fallback priority 6). This means a less up-to-date 
user-dropped replica could be selected before a more up-to-date one. Consider 
moving this check immediately after the `isBad()` check (before line 231) to 
ensure all user-dropped replicas have the lowest priority regardless of their 
version state.



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