[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:
@ -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())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user