Skip to content

Commit

Permalink
[fix](tablet clone) sched wait slot if has be path (apache#22015)
Browse files Browse the repository at this point in the history
  • Loading branch information
yujun777 authored Jul 21, 2023
1 parent 74313c7 commit 94e2c3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,8 @@ private RootPathLoadStatistic chooseAvailableDestPath(TabletSchedCtx tabletCtx,
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());
Expand All @@ -1367,6 +1369,7 @@ private RootPathLoadStatistic chooseAvailableDestPath(TabletSchedCtx tabletCtx,
continue;
}

hasBePath = true;
long pathHash = slot.takeSlot(rootPathLoadStatistic.getPathHash());
if (pathHash == -1) {
LOG.debug("backend {}'s path {}'s slot is full, skip. tablet: {}",
Expand All @@ -1377,7 +1380,13 @@ private RootPathLoadStatistic chooseAvailableDestPath(TabletSchedCtx tabletCtx,
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");
}
}


Expand Down

0 comments on commit 94e2c3c

Please sign in to comment.