[fix](colocation) fix decommission failure with 2 BEs and colocation table (#12644)

This PR fix:

2 Backends.
Create tables with colocation group, 1 replica.
Decommission one of Backends.
The tablet on decommissioned Backend is not reduced.
This is a bug of ColocateTableCheckerAndBalancer.
This commit is contained in:
Mingyu Chen
2022-09-19 08:34:50 +08:00
committed by GitHub
parent 00dda79735
commit a4ed023bad
2 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,7 @@ public class SystemHandler extends AlterHandler {
}
LOG.info("backend {} lefts {} replicas to decommission: {}", beId, backendTabletIds.size(),
backendTabletIds.size() <= 20 ? backendTabletIds : "too many");
backendTabletIds.subList(0, Math.min(10, backendTabletIds.size())));
}
}

View File

@ -385,6 +385,7 @@ public class ColocateTableCheckerAndBalancer extends MasterDaemon {
if (!seqIndexes.isEmpty()) {
srcBeId = beId;
hasUnavailableBe = true;
LOG.info("find unavailable backend {} in colocate group: {}", beId, groupId);
break;
}
}
@ -394,7 +395,7 @@ public class ColocateTableCheckerAndBalancer extends MasterDaemon {
unavailableBeIds, statistic, flatBackendsPerBucketSeq);
// if there is only one available backend and no unavailable bucketId to relocate, end the outer loop
if (backendWithReplicaNum.size() <= 1) {
if (backendWithReplicaNum.size() <= 1 && !hasUnavailableBe) {
break;
}