Skip to content

Commit 1f1a9af

Browse files
committed
add a test
1 parent f43094a commit 1f1a9af

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,6 +2533,12 @@ 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+
25362542
@ConfField(mutable = true, masterOnly = true, description = {
25372543
"Auto Buckets中最小的buckets数目",
25382544
"min buckets of auto bucket"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ 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-
long uncompressedPartitionSize = estimatePartitionSize * 5;
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;
238240
int bucketsNum = AutoBucketUtils.getBucketsNum(uncompressedPartitionSize, Config.autobucket_min_buckets);
239241
LOG.info("autobucket calc with {} history partitions, table: [{}-{}], partition: {}, buckets num: {}, "
240242
+ " 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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,16 +1771,16 @@ public void testAutoBuckets() throws Exception {
17711771
Partition partition = partitions.get(i);
17721772
partition.updateVisibleVersion(2L);
17731773
for (MaterializedIndex idx : partition.getMaterializedIndices(
1774-
MaterializedIndex.IndexExtState.VISIBLE)) {
1774+
MaterializedIndex.IndexExtState.VISIBLE)) {
17751775
for (Tablet tablet : idx.getTablets()) {
17761776
for (Replica replica : tablet.getReplicas()) {
17771777
replica.updateVersion(2L);
17781778
replica.setDataSize(i < 40 ? 0L : 20L << 30);
17791779
replica.setRowCount(1000L);
17801780
}
17811781
}
1782-
}
1783-
}
1782+
}
1783+
}
17841784
} finally {
17851785
table.readUnlock();
17861786
}

0 commit comments

Comments
 (0)