From 94e2c3cf0ff71d2798999f9b65c306a184f610b6 Mon Sep 17 00:00:00 2001 From: yujun Date: Fri, 21 Jul 2023 13:27:40 +0800 Subject: [PATCH] [fix](tablet clone) sched wait slot if has be path (#22015) --- .../java/org/apache/doris/clone/TabletSchedCtx.java | 2 +- .../java/org/apache/doris/clone/TabletScheduler.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java index 286b70f65e..a3734dc9e0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java +++ b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletSchedCtx.java @@ -103,7 +103,7 @@ public class TabletSchedCtx implements Comparable { */ 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(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java index aaaac36a24..ab50bb095b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java +++ b/fe/fe-core/src/main/java/org/apache/doris/clone/TabletScheduler.java @@ -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"); + } }