Skip to content

Commit 92efa84

Browse files
committed
update
1 parent 1f1a9af commit 92efa84

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

fe/fe-common/src/main/java/org/apache/doris/common/Config.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,12 +2533,6 @@ public class Config extends ConfigBase {
25332533
})
25342534
public static long analyze_record_limit = 20000;
25352535

2536-
@ConfField(mutable = true, masterOnly = true, description = {
2537-
"Auto Buckets中预估的压缩数据的倍率",
2538-
"the estimated compress factor of partition size in Auto Buckets"
2539-
})
2540-
public static int autobucket_compress_size_factor = 5;
2541-
25422536
@ConfField(mutable = true, masterOnly = true, description = {
25432537
"Auto Buckets中最小的buckets数目",
25442538
"min buckets of auto bucket"

fe/fe-core/src/main/java/org/apache/doris/clone/BeLoadRebalancer.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,17 @@ protected List<TabletSchedCtx> selectAlternativeTabletsForCluster(
113113
numOfLowPaths += pathSlot.getTotalAvailBalanceSlotNum();
114114
}
115115
}
116-
LOG.info("get number of low load paths: {}, with medium: {}", numOfLowPaths, medium);
116+
LOG.info("get number of low load paths: {}, with medium: {}, tag: {}, isUrgent {}",
117+
numOfLowPaths, medium, clusterStat.getTag(), isUrgent);
117118

118119
List<String> alternativeTabletInfos = Lists.newArrayList();
119120
int clusterAvailableBEnum = infoService.getAllBackendIds(true).size();
120121
List<Set<Long>> lowBETablets = lowBEs.stream()
121122
.map(beStat -> Sets.newHashSet(invertedIndex.getTabletIdsByBackendId(beStat.getBeId())))
122123
.collect(Collectors.toList());
123124

125+
boolean hasCandidateTablet = false;
126+
124127
// choose tablets from high load backends.
125128
// BackendLoadStatistic is sorted by load score in ascend order,
126129
// so we need to traverse it from last to first
@@ -222,6 +225,8 @@ protected List<TabletSchedCtx> selectAlternativeTabletsForCluster(
222225
continue;
223226
}
224227

228+
hasCandidateTablet = true;
229+
225230
// for urgent disk, pick tablets order by size,
226231
// then it may always pick tablets that was on the low backends.
227232
if (!lowBETablets.isEmpty()
@@ -270,6 +275,9 @@ protected List<TabletSchedCtx> selectAlternativeTabletsForCluster(
270275
if (!alternativeTablets.isEmpty()) {
271276
LOG.info("select alternative tablets, medium: {}, is urgent: {}, num: {}, detail: {}",
272277
medium, isUrgent, alternativeTablets.size(), alternativeTabletInfos);
278+
} else if (isUrgent && !hasCandidateTablet) {
279+
LOG.info("urgent balance cann't found candidate tablets. medium: {}, tag: {}",
280+
medium, clusterStat.getTag());
273281
}
274282
return alternativeTablets;
275283
}

fe/fe-core/src/main/java/org/apache/doris/clone/DynamicPartitionScheduler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ private static int getBucketsNum(DynamicPartitionProperty property, OlapTable ta
234234
.collect(Collectors.toCollection(ArrayList::new));
235235
long estimatePartitionSize = getNextPartitionSize(partitionSizeArray);
236236
// plus 5 for uncompressed data
237-
// replica's actual disk usage is a litter bigger then its reported data size
238-
// but 5 times maybe a little too big, i don't known why use so big. just add a config here.
239-
long uncompressedPartitionSize = estimatePartitionSize * Config.autobucket_compress_size_factor;
237+
long uncompressedPartitionSize = estimatePartitionSize * 5;
240238
int bucketsNum = AutoBucketUtils.getBucketsNum(uncompressedPartitionSize, Config.autobucket_min_buckets);
241239
LOG.info("autobucket calc with {} history partitions, table: [{}-{}], partition: {}, buckets num: {}, "
242240
+ " estimate partition size: {}, last partitions(partition name, local size, remote size): {}",

fe/fe-core/src/test/java/org/apache/doris/catalog/DynamicPartitionTableTest.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,20 +1766,25 @@ public void testAutoBuckets() throws Exception {
17661766

17671767
table.readLock();
17681768
try {
1769-
// first 40 partitions with size 0, then 10 partitions with size 20GB
1770-
for (int i = 0; i < 50; i++) {
1769+
// first 40 partitions with size 0, then 13 partitions with size 100GB(10GB * 10 buckets)
1770+
for (int i = 0; i < 52; i++) {
17711771
Partition partition = partitions.get(i);
17721772
partition.updateVisibleVersion(2L);
17731773
for (MaterializedIndex idx : partition.getMaterializedIndices(
17741774
MaterializedIndex.IndexExtState.VISIBLE)) {
1775+
Assert.assertEquals(10, idx.getTablets().size());
17751776
for (Tablet tablet : idx.getTablets()) {
17761777
for (Replica replica : tablet.getReplicas()) {
17771778
replica.updateVersion(2L);
1778-
replica.setDataSize(i < 40 ? 0L : 20L << 30);
1779+
replica.setDataSize(i < 40 ? 0L : 10L << 30);
17791780
replica.setRowCount(1000L);
17801781
}
17811782
}
17821783
}
1784+
if (i >= 40) {
1785+
// first 52 partitions are 10 buckets(FeConstants.default_bucket_num)
1786+
Assert.assertEquals(10 * (10L << 30), partition.getAllDataSize(true));
1787+
}
17831788
}
17841789
} finally {
17851790
table.readUnlock();
@@ -1793,6 +1798,7 @@ public void testAutoBuckets() throws Exception {
17931798
partitions = Lists.newArrayList(table.getAllPartitions());
17941799
partitions.sort(Comparator.comparing(Partition::getId));
17951800
Assert.assertEquals(54, partitions.size());
1796-
Assert.assertTrue(partitions.get(partitions.size() - 1).getDistributionInfo().getBucketNum() > 40);
1801+
// 100GB total, 1GB per bucket, should 100 buckets.
1802+
Assert.assertEquals(100, partitions.get(partitions.size() - 1).getDistributionInfo().getBucketNum());
17971803
}
17981804
}

0 commit comments

Comments
 (0)