Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public List<Replica> getReplicasByTabletId(long tabletId) {
if (replicaMetaTable.containsRow(tabletId)) {
return Lists.newArrayList(replicaMetaTable.row(tabletId).values());
}
return null;
return Lists.newArrayList();
} finally {
readUnlock();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.system.Backend;
import org.apache.doris.system.SystemInfoService;
import org.apache.doris.thrift.TStorageMedium;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
Expand Down Expand Up @@ -241,15 +242,14 @@ public boolean hasAvailDisk() {

/*
* Classify the paths into 'low', 'mid' and 'high',
* and skip offline path
* and skip offline path, and path with different storage medium
*/
public void getPathStatisticByClass(
Set<Long> low,
Set<Long> mid,
Set<Long> high) {
Set<Long> low, Set<Long> mid, Set<Long> high, TStorageMedium storageMedium) {

for (RootPathLoadStatistic pathStat : pathStatistics) {
if (pathStat.getDiskState() == DiskState.OFFLINE) {
if (pathStat.getDiskState() == DiskState.OFFLINE
|| (storageMedium != null && pathStat.getStorageMedium() != storageMedium)) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions fe/src/main/java/org/apache/doris/clone/LoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private List<TabletSchedCtx> selectAlternativeTabletsForCluster(
Set<Long> pathLow = Sets.newHashSet();
Set<Long> pathMid = Sets.newHashSet();
Set<Long> pathHigh = Sets.newHashSet();
beStat.getPathStatisticByClass(pathLow, pathMid, pathHigh);
beStat.getPathStatisticByClass(pathLow, pathMid, pathHigh, null);
// we only select tablets from available mid and high load path
pathHigh.addAll(pathMid);

Expand Down Expand Up @@ -273,7 +273,7 @@ public void createBalanceTask(TabletSchedCtx tabletCtx, Map<Long, PathSlot> back
Set<Long> pathLow = Sets.newHashSet();
Set<Long> pathMid = Sets.newHashSet();
Set<Long> pathHigh = Sets.newHashSet();
beStat.getPathStatisticByClass(pathLow, pathMid, pathHigh);
beStat.getPathStatisticByClass(pathLow, pathMid, pathHigh, tabletCtx.getStorageMedium());
pathLow.addAll(pathMid);

long pathHash = slot.takeAnAvailBalanceSlotFrom(pathLow);
Expand Down
4 changes: 3 additions & 1 deletion fe/src/main/java/org/apache/doris/clone/TabletSchedCtx.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,9 @@ public void chooseDestReplicaForVersionIncomplete(Map<Long, PathSlot> backendsWo
continue;
}

if (replica.getLastFailedVersion() <= 0) {
if (replica.getLastFailedVersion() <= 0 && replica.getVersion() == visibleVersion
&& replica.getVersionHash() == visibleVersionHash) {
// skip healthy replica
continue;
}

Expand Down