Skip to content

Commit

Permalink
[fix](colocation) fix decommission failure with 2 BEs and colocation …
Browse files Browse the repository at this point in the history
…table (apache#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.
  • Loading branch information
morningman authored and Yijia Su committed Oct 8, 2022
1 parent f70f8cd commit bdec9df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void runAlterJobV2() {
}

LOG.info("backend {} lefts {} replicas to decommission: {}", beId, backendTabletIds.size(),
backendTabletIds.size() <= 20 ? backendTabletIds : "too many");
backendTabletIds.subList(0, Math.min(10, backendTabletIds.size())));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ private boolean relocateAndBalance(GroupId groupId, Tag tag, Set<Long> unavailab
if (!seqIndexes.isEmpty()) {
srcBeId = beId;
hasUnavailableBe = true;
LOG.info("find unavailable backend {} in colocate group: {}", beId, groupId);
break;
}
}
Expand All @@ -394,7 +395,7 @@ private boolean relocateAndBalance(GroupId groupId, Tag tag, Set<Long> unavailab
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;
}

Expand Down

0 comments on commit bdec9df

Please sign in to comment.