From e2d5532e3f0fe9bec6b3edb1b87546b89836257a Mon Sep 17 00:00:00 2001 From: yujun Date: Sun, 3 Dec 2023 23:05:52 +0800 Subject: [PATCH] [improvement](disk migration) disk migration skip cooldown tablets (#27807) --- .../apache/doris/clone/DiskRebalancer.java | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/clone/DiskRebalancer.java b/fe/fe-core/src/main/java/org/apache/doris/clone/DiskRebalancer.java index 3ab069d09e..36fcb2a4e2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/clone/DiskRebalancer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/clone/DiskRebalancer.java @@ -18,10 +18,7 @@ package org.apache.doris.clone; import org.apache.doris.catalog.CatalogRecycleBin; -import org.apache.doris.catalog.DataProperty; -import org.apache.doris.catalog.Database; import org.apache.doris.catalog.Env; -import org.apache.doris.catalog.OlapTable; import org.apache.doris.catalog.Replica; import org.apache.doris.catalog.TabletInvertedIndex; import org.apache.doris.catalog.TabletMeta; @@ -33,8 +30,8 @@ import org.apache.doris.clone.TabletScheduler.PathSlot; import org.apache.doris.common.FeConstants; import org.apache.doris.system.SystemInfoService; import org.apache.doris.thrift.TStorageMedium; +import org.apache.doris.thrift.TUniqueId; -import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -222,6 +219,12 @@ public class DiskRebalancer extends Rebalancer { continue; } + // backend not support migrate cooldown tablets + TUniqueId cooldownMetaId = replica.getCooldownMetaId(); + if (cooldownMetaId != null && (cooldownMetaId.getLo() != 0 || cooldownMetaId.getHi() != 0)) { + continue; + } + // check if replica's is on 'high' path. // and only select it if the selected tablets num of this path // does not exceed the limit (BALANCE_SLOT_NUM_FOR_PATH). @@ -303,21 +306,6 @@ public class DiskRebalancer extends Rebalancer { if (replica.getDataSize() == 0) { throw new SchedException(Status.UNRECOVERABLE, SubCode.DIAGNOSE_IGNORE, "size of src replica is zero"); } - Database db = Env.getCurrentInternalCatalog().getDbOrException(tabletCtx.getDbId(), - s -> new SchedException(Status.UNRECOVERABLE, SubCode.DIAGNOSE_IGNORE, - "db " + tabletCtx.getDbId() + " does not exist")); - OlapTable tbl = (OlapTable) db.getTableOrException(tabletCtx.getTblId(), - s -> new SchedException(Status.UNRECOVERABLE, SubCode.DIAGNOSE_IGNORE, - "tbl " + tabletCtx.getTblId() + " does not exist")); - DataProperty dataProperty = tbl.getPartitionInfo().getDataProperty(tabletCtx.getPartitionId()); - if (dataProperty == null) { - throw new SchedException(Status.UNRECOVERABLE, "data property is null"); - } - String storagePolicy = dataProperty.getStoragePolicy(); - if (!Strings.isNullOrEmpty(storagePolicy)) { - throw new SchedException(Status.UNRECOVERABLE, SubCode.DIAGNOSE_IGNORE, - "disk balance not support for cooldown storage"); - } // check src slot PathSlot slot = backendsWorkingSlots.get(replica.getBackendId());