diff --git a/fe/fe-core/src/main/java/com/starrocks/catalog/OlapTable.java b/fe/fe-core/src/main/java/com/starrocks/catalog/OlapTable.java index 37b54213d573b..ff9c33db237a6 100644 --- a/fe/fe-core/src/main/java/com/starrocks/catalog/OlapTable.java +++ b/fe/fe-core/src/main/java/com/starrocks/catalog/OlapTable.java @@ -1851,7 +1851,9 @@ public TTableDescriptor toThrift(List partitions) { public long getRowCount() { long rowCount = 0; for (Map.Entry entry : idToPartition.entrySet()) { - rowCount += entry.getValue().getBaseIndex().getRowCount(); + for (PhysicalPartition partition : entry.getValue().getSubPartitions()) { + rowCount += partition.getBaseIndex().getRowCount(); + } } return rowCount; } @@ -3151,9 +3153,11 @@ public void removeTabletsFromInvertedIndex() { TabletInvertedIndex invertedIndex = GlobalStateMgr.getCurrentState().getTabletInvertedIndex(); Collection allPartitions = getAllPartitions(); for (Partition partition : allPartitions) { - for (MaterializedIndex index : partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { - for (Tablet tablet : index.getTablets()) { - invertedIndex.deleteTablet(tablet.getId()); + for (PhysicalPartition subPartition : partition.getSubPartitions()) { + for (MaterializedIndex index : subPartition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { + for (Tablet tablet : index.getTablets()) { + invertedIndex.deleteTablet(tablet.getId()); + } } } } diff --git a/fe/fe-core/src/main/java/com/starrocks/clone/DiskAndTabletLoadReBalancer.java b/fe/fe-core/src/main/java/com/starrocks/clone/DiskAndTabletLoadReBalancer.java index d895abf3d161f..a1e5bbd9ff78b 100644 --- a/fe/fe-core/src/main/java/com/starrocks/clone/DiskAndTabletLoadReBalancer.java +++ b/fe/fe-core/src/main/java/com/starrocks/clone/DiskAndTabletLoadReBalancer.java @@ -280,7 +280,7 @@ public void completeSchedCtx(TabletSchedCtx tabletCtx, Map p = Pair.create(tabletMeta.getPartitionId(), tabletMeta.getIndexId()); - // p: partition + // p: partition // k: partition same to p srcPathPartitionTablets.compute(p, (k, pTablets) -> { if (pTablets != null) { @@ -980,7 +980,7 @@ private Map, Set> getPartitionTablets(long beId, TStorage } } - Pair key = new Pair<>(tabletMeta.getPartitionId(), tabletMeta.getIndexId()); + Pair key = new Pair<>(tabletMeta.getPhysicalPartitionId(), tabletMeta.getIndexId()); partitionTablets.computeIfAbsent(key, k -> Sets.newHashSet()).add(tabletId); } return partitionTablets; @@ -1002,7 +1002,7 @@ private Map, Double> getPartitionAvgReplicaSize(long beId, return result; } - private int getPartitionTabletNumOnBePath(long dbId, long tableId, long partitionId, long indexId, long beId, + private int getPartitionTabletNumOnBePath(long dbId, long tableId, long physicalPartitionId, long indexId, long beId, long pathHash) { GlobalStateMgr globalStateMgr = GlobalStateMgr.getCurrentState(); Database db = globalStateMgr.getLocalMetastore().getDbIncludeRecycleBin(dbId); @@ -1018,29 +1018,28 @@ private int getPartitionTabletNumOnBePath(long dbId, long tableId, long partitio return 0; } - Partition partition = globalStateMgr.getLocalMetastore().getPartitionIncludeRecycleBin(table, partitionId); - if (partition == null) { + PhysicalPartition physicalPartition = globalStateMgr.getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin(table, physicalPartitionId); + if (physicalPartition == null) { return 0; } int cnt = 0; - for (PhysicalPartition physicalPartition : partition.getSubPartitions()) { - MaterializedIndex index = physicalPartition.getIndex(indexId); - if (index == null) { + MaterializedIndex index = physicalPartition.getIndex(indexId); + if (index == null) { + return 0; + } + + for (Tablet tablet : index.getTablets()) { + List replicas = ((LocalTablet) tablet).getImmutableReplicas(); + if (replicas == null) { continue; } - for (Tablet tablet : index.getTablets()) { - List replicas = ((LocalTablet) tablet).getImmutableReplicas(); - if (replicas == null) { - continue; - } - - for (Replica replica : replicas) { - if (replica.getState() == ReplicaState.NORMAL && replica.getBackendId() == beId) { - if (pathHash == -1 || replica.getPathHash() == pathHash) { - cnt++; - } + for (Replica replica : replicas) { + if (replica.getState() == ReplicaState.NORMAL && replica.getBackendId() == beId) { + if (pathHash == -1 || replica.getPathHash() == pathHash) { + cnt++; } } } @@ -1440,11 +1439,11 @@ private TabletSchedCtx tryToBalanceTablet(Pair> srcTablets, } /** - * Get beId or pathHash to tablets by partitionId and indexId. + * Get beId or pathHash to tablets by physicalPartitionId and indexId. * If beIds is not null, return beId => Set. * If bePaths is not null, return pathHash => Set. */ - private List>> getPartitionTablets(Long dbId, Long tableId, Long partitionId, Long indexId, + private List>> getPartitionTablets(Long dbId, Long tableId, Long physicalPartitionId, Long indexId, List beIds, Pair> bePaths) { Preconditions.checkArgument(beIds != null || bePaths != null); @@ -1467,66 +1466,65 @@ private List>> getPartitionTablets(Long dbId, Long tableId, return result; } - Partition partition = globalStateMgr.getLocalMetastore().getPartitionIncludeRecycleBin(table, partitionId); - if (partition == null) { + PhysicalPartition physicalPartition = globalStateMgr.getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin(table, physicalPartitionId); + if (physicalPartition == null) { + return result; + } + + MaterializedIndex index = physicalPartition.getIndex(indexId); + if (index == null) { return result; } - for (PhysicalPartition physicalPartition : partition.getSubPartitions()) { - MaterializedIndex index = physicalPartition.getIndex(indexId); - if (index == null) { + // tablets on be|path + Map> tablets = Maps.newHashMap(); + if (beIds != null) { + for (Long beId : beIds) { + tablets.put(beId, Sets.newHashSet()); + } + } else { + for (Long pathHash : bePaths.second) { + tablets.put(pathHash, Sets.newHashSet()); + } + } + for (Tablet tablet : index.getTablets()) { + List replicas = ((LocalTablet) tablet).getImmutableReplicas(); + if (replicas == null) { continue; } - // tablets on be|path - Map> tablets = Maps.newHashMap(); - if (beIds != null) { - for (Long beId : beIds) { - tablets.put(beId, Sets.newHashSet()); - } - } else { - for (Long pathHash : bePaths.second) { - tablets.put(pathHash, Sets.newHashSet()); - } - } - for (Tablet tablet : index.getTablets()) { - List replicas = ((LocalTablet) tablet).getImmutableReplicas(); - if (replicas == null) { + for (Replica replica : replicas) { + if (replica.getState() != ReplicaState.NORMAL) { continue; } - for (Replica replica : replicas) { - if (replica.getState() != ReplicaState.NORMAL) { - continue; - } + RootPathLoadStatistic pathLoadStatistic = loadStatistic + .getRootPathLoadStatistic(replica.getBackendId(), replica.getPathHash()); + if (pathLoadStatistic == null || pathLoadStatistic.getDiskState() != DiskInfo.DiskState.ONLINE) { + continue; + } - RootPathLoadStatistic pathLoadStatistic = loadStatistic - .getRootPathLoadStatistic(replica.getBackendId(), replica.getPathHash()); - if (pathLoadStatistic == null || pathLoadStatistic.getDiskState() != DiskInfo.DiskState.ONLINE) { + if (beIds != null) { + tablets.computeIfPresent(replica.getBackendId(), (k, v) -> { + v.add(tablet.getId()); + return v; + }); + } else { + if (replica.getBackendId() != bePaths.first || + !bePaths.second.contains(replica.getPathHash())) { continue; } - - if (beIds != null) { - tablets.computeIfPresent(replica.getBackendId(), (k, v) -> { - v.add(tablet.getId()); - return v; - }); - } else { - if (replica.getBackendId() != bePaths.first || - !bePaths.second.contains(replica.getPathHash())) { - continue; - } - tablets.computeIfPresent(replica.getPathHash(), (k, v) -> { - v.add(tablet.getId()); - return v; - }); - } + tablets.computeIfPresent(replica.getPathHash(), (k, v) -> { + v.add(tablet.getId()); + return v; + }); } } + } - for (Map.Entry> entry : tablets.entrySet()) { - result.add(new Pair<>(entry.getKey(), entry.getValue())); - } + for (Map.Entry> entry : tablets.entrySet()) { + result.add(new Pair<>(entry.getKey(), entry.getValue())); } } finally { locker.unLockDatabase(db, LockType.READ); @@ -1546,8 +1544,8 @@ private boolean isTabletUnhealthy(long dbId, OlapTable olapTable, Long tabletId, Locker locker = new Locker(); try { locker.lockDatabase(db, LockType.READ); - Partition partition = globalStateMgr.getLocalMetastore() - .getPartitionIncludeRecycleBin(olapTable, tabletMeta.getPartitionId()); + PhysicalPartition partition = globalStateMgr.getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin(olapTable, tabletMeta.getPhysicalPartitionId()); if (partition == null) { return true; } @@ -1563,7 +1561,7 @@ private boolean isTabletUnhealthy(long dbId, OlapTable olapTable, Long tabletId, } short replicaNum = globalStateMgr.getLocalMetastore() - .getReplicationNumIncludeRecycleBin(olapTable.getPartitionInfo(), partition.getId()); + .getReplicationNumIncludeRecycleBin(olapTable.getPartitionInfo(), partition.getParentId()); if (replicaNum == (short) -1) { return true; } @@ -1691,51 +1689,55 @@ private Map, PartitionStat> getPartitionStats(TStorageMedium me /* * Tablet in SHADOW index can not be repaired of balanced */ - for (MaterializedIndex idx : partition - .getMaterializedIndices(MaterializedIndex.IndexExtState.VISIBLE)) { - PartitionStat pStat = new PartitionStat(dbId, table.getId(), 0, replicaNum, - replicationFactor); - partitionStats.put(new Pair<>(partition.getId(), idx.getId()), pStat); - - if (beIds == null && bePaths == null) { - continue; - } - - // calculate skew - // replicaNum on be|path - Map replicaNums = getBackendOrPathToReplicaNum(beIds, bePaths); - for (Tablet tablet : idx.getTablets()) { - List replicas = ((LocalTablet) tablet).getImmutableReplicas(); - if (replicas != null) { - for (Replica replica : replicas) { - if (replica.getState() != ReplicaState.NORMAL) { - continue; - } + for (PhysicalPartition physicalPartition : partition.getSubPartitions()) { + for (MaterializedIndex idx : physicalPartition + .getMaterializedIndices(MaterializedIndex.IndexExtState.VISIBLE)) { + PartitionStat pStat = new PartitionStat(dbId, table.getId(), 0, replicaNum, + replicationFactor); + partitionStats.put(new Pair<>(physicalPartition.getId(), idx.getId()), pStat); + + if (beIds == null && bePaths == null) { + continue; + } - if (beIds != null) { - replicaNums.computeIfPresent(replica.getBackendId(), (k, v) -> (v + 1)); - } else { - if (replica.getBackendId() != bePaths.first) { + // calculate skew + // replicaNum on be|path + Map replicaNums = getBackendOrPathToReplicaNum(beIds, bePaths); + for (Tablet tablet : idx.getTablets()) { + List replicas = ((LocalTablet) tablet).getImmutableReplicas(); + if (replicas != null) { + for (Replica replica : replicas) { + if (replica.getState() != ReplicaState.NORMAL) { continue; } - replicaNums.computeIfPresent(replica.getPathHash(), (k, v) -> (v + 1)); + if (beIds != null) { + replicaNums.computeIfPresent(replica.getBackendId(), (k, v) -> (v + 1)); + } else { + if (replica.getBackendId() != bePaths.first) { + continue; + } + + replicaNums.computeIfPresent(replica.getPathHash(), (k, v) -> (v + 1)); + } } } } - } - int maxNum = Integer.MIN_VALUE; - int minNum = Integer.MAX_VALUE; - for (int num : replicaNums.values()) { - if (maxNum < num) { - maxNum = num; - } - if (minNum > num) { - minNum = num; + int maxNum = Integer.MIN_VALUE; + int minNum = Integer.MAX_VALUE; + for (int num : replicaNums.values()) { + if (maxNum < num) { + maxNum = num; + } + if (minNum > num) { + minNum = num; + } } - } - pStat.skew = maxNum - minNum; + pStat.skew = maxNum - minNum; + LOG.info("add partition stat: {} id: {}", + pStat, new Pair<>(physicalPartition.getId(), idx.getId())); + } } } } @@ -1987,7 +1989,7 @@ public static class BackendBalanceState { TStorageMedium medium; List> sortedPartitions; TabletInvertedIndex tabletInvertedIndex; - // => tablets in that partition + // => tablets in that partition // tablets is sorted by data size in desc order for the BE in high load group Map, List> partitionTablets; // total data used capacity diff --git a/fe/fe-core/src/main/java/com/starrocks/load/ExportJob.java b/fe/fe-core/src/main/java/com/starrocks/load/ExportJob.java index d0e1a76fc22bf..fc890e9264e68 100644 --- a/fe/fe-core/src/main/java/com/starrocks/load/ExportJob.java +++ b/fe/fe-core/src/main/java/com/starrocks/load/ExportJob.java @@ -54,7 +54,7 @@ import com.starrocks.catalog.Database; import com.starrocks.catalog.MaterializedIndex; import com.starrocks.catalog.MysqlTable; -import com.starrocks.catalog.Partition; +import com.starrocks.catalog.PhysicalPartition; import com.starrocks.catalog.PrimitiveType; import com.starrocks.catalog.Replica; import com.starrocks.catalog.Table; @@ -361,7 +361,7 @@ private void genTaskFragments(List fragments, List scanN TabletMeta tabletMeta = invertedIndex.getTabletMeta(tabletId); long dataSize = 0L; if (tabletMeta.isLakeTablet()) { - Partition partition = exportTable.getPartition(tabletMeta.getPartitionId()); + PhysicalPartition partition = exportTable.getPhysicalPartition(tabletMeta.getPhysicalPartitionId()); if (partition != null) { MaterializedIndex index = partition.getIndex(tabletMeta.getIndexId()); if (index != null) { diff --git a/fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobRunner.java b/fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobRunner.java index b53ce7a0180b6..a2169e4870436 100644 --- a/fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobRunner.java +++ b/fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobRunner.java @@ -27,6 +27,7 @@ import com.starrocks.catalog.Partition; import com.starrocks.catalog.PartitionInfo; import com.starrocks.catalog.PartitionType; +import com.starrocks.catalog.PhysicalPartition; import com.starrocks.catalog.SinglePartitionInfo; import com.starrocks.catalog.Table; import com.starrocks.catalog.Tablet; @@ -408,9 +409,11 @@ private void gc(boolean isReplay) { Partition partition = targetTable.getPartition(pid); if (partition != null) { - for (MaterializedIndex index : partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { - // hash set is able to deduplicate the elements - sourceTablets.addAll(index.getTablets()); + for (PhysicalPartition subPartition : partition.getSubPartitions()) { + for (MaterializedIndex index : subPartition.getMaterializedIndices( + MaterializedIndex.IndexExtState.ALL)) { + sourceTablets.addAll(index.getTablets()); + } } targetTable.dropTempPartition(partition.getName(), true); } else { @@ -470,8 +473,10 @@ private void doCommit(boolean isReplay) { Set sourceTablets = Sets.newHashSet(); sourcePartitionNames.forEach(name -> { Partition partition = targetTable.getPartition(name); - for (MaterializedIndex index : partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { - sourceTablets.addAll(index.getTablets()); + for (PhysicalPartition subPartition : partition.getSubPartitions()) { + for (MaterializedIndex index : subPartition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { + sourceTablets.addAll(index.getTablets()); + } } }); long sumSourceRows = job.getSourcePartitionIds().stream() diff --git a/fe/fe-core/src/main/java/com/starrocks/load/PartitionUtils.java b/fe/fe-core/src/main/java/com/starrocks/load/PartitionUtils.java index e380fa06d65d4..dec21397d2090 100644 --- a/fe/fe-core/src/main/java/com/starrocks/load/PartitionUtils.java +++ b/fe/fe-core/src/main/java/com/starrocks/load/PartitionUtils.java @@ -24,6 +24,7 @@ import com.starrocks.catalog.Partition; import com.starrocks.catalog.PartitionInfo; import com.starrocks.catalog.PartitionKey; +import com.starrocks.catalog.PhysicalPartition; import com.starrocks.catalog.RangePartitionInfo; import com.starrocks.catalog.Table; import com.starrocks.catalog.Tablet; @@ -149,9 +150,12 @@ public static void createAndAddTempPartitionsForTable(Database db, OlapTable tar public static void clearTabletsFromInvertedIndex(List partitions) { TabletInvertedIndex invertedIndex = GlobalStateMgr.getCurrentState().getTabletInvertedIndex(); for (Partition partition : partitions) { - for (MaterializedIndex materializedIndex : partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { - for (Tablet tablet : materializedIndex.getTablets()) { - invertedIndex.deleteTablet(tablet.getId()); + for (PhysicalPartition subPartition : partition.getSubPartitions()) { + for (MaterializedIndex materializedIndex : subPartition.getMaterializedIndices( + MaterializedIndex.IndexExtState.ALL)) { + for (Tablet tablet : materializedIndex.getTablets()) { + invertedIndex.deleteTablet(tablet.getId()); + } } } } diff --git a/fe/fe-core/src/main/java/com/starrocks/planner/MetaScanNode.java b/fe/fe-core/src/main/java/com/starrocks/planner/MetaScanNode.java index a6909e9f65b52..e16bda728cbfc 100644 --- a/fe/fe-core/src/main/java/com/starrocks/planner/MetaScanNode.java +++ b/fe/fe-core/src/main/java/com/starrocks/planner/MetaScanNode.java @@ -20,7 +20,7 @@ import com.starrocks.catalog.LocalTablet; import com.starrocks.catalog.MaterializedIndex; import com.starrocks.catalog.OlapTable; -import com.starrocks.catalog.Partition; +import com.starrocks.catalog.PhysicalPartition; import com.starrocks.catalog.Replica; import com.starrocks.catalog.Tablet; import com.starrocks.lake.LakeTablet; @@ -65,8 +65,8 @@ public MetaScanNode(PlanNodeId id, TupleDescriptor desc, OlapTable olapTable, } public void computeRangeLocations() { - Collection partitions = olapTable.getPartitions(); - for (Partition partition : partitions) { + Collection partitions = olapTable.getPhysicalPartitions(); + for (PhysicalPartition partition : partitions) { MaterializedIndex index = partition.getBaseIndex(); int schemaHash = olapTable.getSchemaHashByIndexId(index.getId()); List tablets = index.getTablets(); diff --git a/fe/fe-core/src/main/java/com/starrocks/server/LocalMetastore.java b/fe/fe-core/src/main/java/com/starrocks/server/LocalMetastore.java index 012562fc41208..e98c26231c3aa 100644 --- a/fe/fe-core/src/main/java/com/starrocks/server/LocalMetastore.java +++ b/fe/fe-core/src/main/java/com/starrocks/server/LocalMetastore.java @@ -4971,10 +4971,12 @@ public void onEraseDatabase(long dbId) { public void onErasePartition(Partition partition) { // remove tablet in inverted index TabletInvertedIndex invertedIndex = GlobalStateMgr.getCurrentState().getTabletInvertedIndex(); - for (MaterializedIndex index : partition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { - for (Tablet tablet : index.getTablets()) { - long tabletId = tablet.getId(); - invertedIndex.deleteTablet(tabletId); + for (PhysicalPartition subPartition : partition.getSubPartitions()) { + for (MaterializedIndex index : subPartition.getMaterializedIndices(MaterializedIndex.IndexExtState.ALL)) { + for (Tablet tablet : index.getTablets()) { + long tabletId = tablet.getId(); + invertedIndex.deleteTablet(tabletId); + } } } } diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/Explain.java b/fe/fe-core/src/main/java/com/starrocks/sql/Explain.java index f75d1ce7cf653..69e374ae79825 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/Explain.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/Explain.java @@ -24,6 +24,7 @@ import com.starrocks.catalog.MaterializedIndex; import com.starrocks.catalog.OlapTable; import com.starrocks.catalog.Partition; +import com.starrocks.catalog.PhysicalPartition; import com.starrocks.sql.common.ErrorType; import com.starrocks.sql.common.StarRocksPlannerException; import com.starrocks.sql.optimizer.ExpressionContext; @@ -204,8 +205,10 @@ public OperatorStr visitPhysicalOlapScan(OptExpression optExpression, OperatorPr int totalTabletsNum = 0; for (Long partitionId : scan.getSelectedPartitionId()) { final Partition partition = ((OlapTable) scan.getTable()).getPartition(partitionId); - final MaterializedIndex selectedTable = partition.getIndex(scan.getSelectedIndexId()); - totalTabletsNum += selectedTable.getTablets().size(); + for (PhysicalPartition subPartition : partition.getSubPartitions()) { + final MaterializedIndex selectedTable = subPartition.getIndex(scan.getSelectedIndexId()); + totalTabletsNum += selectedTable.getTablets().size(); + } } String partitionAndBucketInfo = "partitionRatio: " + scan.getSelectedPartitionId().size() + diff --git a/fe/fe-core/src/test/java/com/starrocks/clone/DiskAndTabletLoadReBalancerTest.java b/fe/fe-core/src/test/java/com/starrocks/clone/DiskAndTabletLoadReBalancerTest.java index b488978a879bd..9584f3de32cac 100644 --- a/fe/fe-core/src/test/java/com/starrocks/clone/DiskAndTabletLoadReBalancerTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/clone/DiskAndTabletLoadReBalancerTest.java @@ -150,7 +150,8 @@ public void testBalance(@Mocked GlobalStateMgr globalStateMgr) { result = Lists.newArrayList(table); minTimes = 0; - GlobalStateMgr.getCurrentState().getLocalMetastore().getPartitionIncludeRecycleBin((OlapTable) any, anyLong); + GlobalStateMgr.getCurrentState().getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin((OlapTable) any, anyLong); result = partition; minTimes = 0; @@ -312,7 +313,8 @@ public void testBalanceWithSameHost(@Mocked GlobalStateMgr globalStateMgr) { result = Lists.newArrayList(table); minTimes = 0; - GlobalStateMgr.getCurrentState().getLocalMetastore().getPartitionIncludeRecycleBin((OlapTable) any, anyLong); + GlobalStateMgr.getCurrentState().getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin((OlapTable) any, anyLong); result = partition; minTimes = 0; @@ -494,11 +496,13 @@ public void testBalanceBackendTablet(@Mocked GlobalStateMgr globalStateMgr) { result = Lists.newArrayList(table); minTimes = 0; - GlobalStateMgr.getCurrentState().getLocalMetastore().getPartitionIncludeRecycleBin((OlapTable) any, partitionId1); + GlobalStateMgr.getCurrentState().getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin((OlapTable) any, partitionId1); result = partition1; minTimes = 0; - GlobalStateMgr.getCurrentState().getLocalMetastore().getPartitionIncludeRecycleBin((OlapTable) any, partitionId2); + GlobalStateMgr.getCurrentState().getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin((OlapTable) any, partitionId2); result = partition2; minTimes = 0; @@ -685,7 +689,8 @@ public void testBalanceParallel(@Mocked GlobalStateMgr globalStateMgr) { result = Lists.newArrayList(table); minTimes = 0; - GlobalStateMgr.getCurrentState().getLocalMetastore().getPartitionIncludeRecycleBin((OlapTable) any, anyLong); + GlobalStateMgr.getCurrentState().getLocalMetastore() + .getPhysicalPartitionIncludeRecycleBin((OlapTable) any, anyLong); result = partition; minTimes = 0;