wangbo commented on a change in pull request #5250:
URL: https://github.com/apache/incubator-doris/pull/5250#discussion_r565845937
##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
##########
@@ -542,19 +542,20 @@ public long getDataSize(boolean singleReplica) {
* No need to check if backend is available. We consider all backends in
'backendsSet' are available,
* If not, unavailable backends will be relocated by CalocateTableBalancer
first.
*/
- public TabletStatus getColocateHealthStatus(long visibleVersion, long
visibleVersionHash,
- int replicationNum, Set<Long> backendsSet) {
+ public TabletStatus getColocateHealthStatus(long visibleVersion, int
replicationNum, Set<Long> backendsSet) {
// 1. check if replicas' backends are mismatch
Set<Long> replicaBackendIds = getBackendIds();
- for (Long backendId : backendsSet) {
- if (!replicaBackendIds.contains(backendId)) {
- return TabletStatus.COLOCATE_MISMATCH;
- }
+ if (!replicaBackendIds.containsAll(backendsSet)) {
+ return TabletStatus.COLOCATE_MISMATCH;
}
// 2. check version completeness
for (Replica replica : replicas) {
+ if (!backendsSet.contains(replica.getBackendId())) {
+ // We don't care about replicas that are not in backendsSet
Review comment:
```suggestion
// We don't care about replicas that are not in backendsSet.
// eg: replicaBackendIds=(1,2,3,4); backendsSet=(1,2,3),
then replica 4 should be skipped here and then goto ```COLOCATE_REDUNDANT``` in
step 3
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]