[fix](tablet-scheduler) Fix decommission backend bug (#7563)

Fix bug that decommission backend operation blocked with error:
`no proper tag is chose for tablet.`
This commit is contained in:
Mingyu Chen
2022-01-06 00:08:06 +08:00
committed by GitHub
parent 2a2f12ca51
commit e1374d8536

View File

@ -646,7 +646,7 @@ public class TabletScheduler extends MasterDaemon {
Map<Tag, Short> currentAllocMap = Maps.newHashMap();
for (Replica replica : replicas) {
Backend be = infoService.getBackend(replica.getBackendId());
if (be != null && be.isAlive() && replica.isAlive()) {
if (be != null && be.isScheduleAvailable() && replica.isAlive()) {
Short num = currentAllocMap.getOrDefault(be.getTag(), (short) 0);
currentAllocMap.put(be.getTag(), (short) (num + 1));
}