[fix](tablet clone) sched wait slot if has be path (#22015)

This commit is contained in:
yujun
2023-07-21 13:27:40 +08:00
committed by GitHub
parent 74313c7d54
commit 94e2c3cf0f
2 changed files with 11 additions and 2 deletions

View File

@ -103,7 +103,7 @@ public class TabletSchedCtx implements Comparable<TabletSchedCtx> {
*/
private static final int RUNNING_FAILED_COUNTER_THRESHOLD = 3;
public static final int FINISHED_COUNTER_THRESHOLD = 3;
public static final int FINISHED_COUNTER_THRESHOLD = 4;
private static VersionCountComparator VERSION_COUNTER_COMPARATOR = new VersionCountComparator();

View File

@ -1357,6 +1357,8 @@ public class TabletScheduler extends MasterDaemon {
return rootPathLoadStatistic;
}
boolean hasBePath = false;
// no root path with specified media type is found, get arbitrary one.
for (RootPathLoadStatistic rootPathLoadStatistic : allFitPaths) {
PathSlot slot = backendsWorkingSlots.get(rootPathLoadStatistic.getBeId());
@ -1367,6 +1369,7 @@ public class TabletScheduler extends MasterDaemon {
continue;
}
hasBePath = true;
long pathHash = slot.takeSlot(rootPathLoadStatistic.getPathHash());
if (pathHash == -1) {
LOG.debug("backend {}'s path {}'s slot is full, skip. tablet: {}",
@ -1377,7 +1380,13 @@ public class TabletScheduler extends MasterDaemon {
return rootPathLoadStatistic;
}
throw new SchedException(Status.UNRECOVERABLE, "unable to find dest path which can be fit in");
if (hasBePath) {
throw new SchedException(Status.SCHEDULE_FAILED, SubCode.WAITING_SLOT,
"unable to find dest path which can be fit in");
} else {
throw new SchedException(Status.UNRECOVERABLE,
"unable to find dest path which can be fit in");
}
}