This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new d079be22899 branch-4.1: [chore](compaction) change time series
threshold from 2000 to 1000 #61979 (#62444)
d079be22899 is described below
commit d079be22899511b57302733042f58a2a457af41f
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Apr 15 12:08:21 2026 +0800
branch-4.1: [chore](compaction) change time series threshold from 2000 to
1000 #61979 (#62444)
Cherry-picked from #61979
Co-authored-by: Chenyang Sun <[email protected]>
---
be/src/storage/tablet/tablet_meta.h | 2 +-
.../apache/doris/common/util/PropertyAnalyzer.java | 2 +-
gensrc/proto/olap_file.proto | 4 +--
gensrc/thrift/AgentService.thrift | 2 +-
.../data/query_p0/system/test_table_properties.out | 12 +++----
.../test_time_series_compaction_policy.groovy | 42 ++++++++++++++++++++++
6 files changed, 53 insertions(+), 11 deletions(-)
diff --git a/be/src/storage/tablet/tablet_meta.h
b/be/src/storage/tablet/tablet_meta.h
index 046f0ca6f8a..6adcbb05214 100644
--- a/be/src/storage/tablet/tablet_meta.h
+++ b/be/src/storage/tablet/tablet_meta.h
@@ -111,7 +111,7 @@ public:
std::optional<TBinlogConfig> binlog_config = {},
std::string compaction_policy = "size_based",
int64_t time_series_compaction_goal_size_mbytes = 1024,
- int64_t time_series_compaction_file_count_threshold = 2000,
+ int64_t time_series_compaction_file_count_threshold = 1000,
int64_t time_series_compaction_time_threshold_seconds = 3600,
int64_t time_series_compaction_empty_rowsets_threshold = 5,
int64_t time_series_compaction_level_threshold = 1,
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
index 66d4e8fd2a1..d732b4fc999 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
@@ -262,7 +262,7 @@ public class PropertyAnalyzer {
public static final String SIZE_BASED_COMPACTION_POLICY = "size_based";
public static final String TIME_SERIES_COMPACTION_POLICY = "time_series";
public static final long
TIME_SERIES_COMPACTION_GOAL_SIZE_MBYTES_DEFAULT_VALUE = 1024;
- public static final long
TIME_SERIES_COMPACTION_FILE_COUNT_THRESHOLD_DEFAULT_VALUE = 2000;
+ public static final long
TIME_SERIES_COMPACTION_FILE_COUNT_THRESHOLD_DEFAULT_VALUE = 1000;
public static final long
TIME_SERIES_COMPACTION_TIME_THRESHOLD_SECONDS_DEFAULT_VALUE = 3600;
public static final long
TIME_SERIES_COMPACTION_EMPTY_ROWSETS_THRESHOLD_DEFAULT_VALUE = 5;
public static final long
TIME_SERIES_COMPACTION_LEVEL_THRESHOLD_DEFAULT_VALUE = 1;
diff --git a/gensrc/proto/olap_file.proto b/gensrc/proto/olap_file.proto
index ee4ab3b51df..14fe33fde0b 100644
--- a/gensrc/proto/olap_file.proto
+++ b/gensrc/proto/olap_file.proto
@@ -613,7 +613,7 @@ message TabletMetaPB {
optional BinlogConfigPB binlog_config = 27;
optional string compaction_policy = 28 [default = "size_based"];
optional int64 time_series_compaction_goal_size_mbytes = 29 [default =
1024];
- optional int64 time_series_compaction_file_count_threshold = 30 [default =
2000];
+ optional int64 time_series_compaction_file_count_threshold = 30 [default =
1000];
optional int64 time_series_compaction_time_threshold_seconds = 31 [default
= 3600];
optional int64 time_series_compaction_empty_rowsets_threshold = 32
[default = 5];
optional int64 time_series_compaction_level_threshold = 33 [default = 1];
@@ -669,7 +669,7 @@ message TabletMetaCloudPB {
optional BinlogConfigPB binlog_config = 30;
optional string compaction_policy = 31 [default = "size_based"];
optional int64 time_series_compaction_goal_size_mbytes = 32 [default =
1024];
- optional int64 time_series_compaction_file_count_threshold = 33 [default =
2000];
+ optional int64 time_series_compaction_file_count_threshold = 33 [default =
1000];
optional int64 time_series_compaction_time_threshold_seconds = 34 [default
= 3600];
reserved 35; // deprecated group_commit_interval_ms
reserved 36; // deprecated group_commit_data_bytes
diff --git a/gensrc/thrift/AgentService.thrift
b/gensrc/thrift/AgentService.thrift
index 9741535681e..969bcfd142e 100644
--- a/gensrc/thrift/AgentService.thrift
+++ b/gensrc/thrift/AgentService.thrift
@@ -220,7 +220,7 @@ struct TCreateTabletReq {
21: optional TBinlogConfig binlog_config
22: optional string compaction_policy = "size_based"
23: optional i64 time_series_compaction_goal_size_mbytes = 1024
- 24: optional i64 time_series_compaction_file_count_threshold = 2000
+ 24: optional i64 time_series_compaction_file_count_threshold = 1000
25: optional i64 time_series_compaction_time_threshold_seconds = 3600
26: optional i64 time_series_compaction_empty_rowsets_threshold = 5
27: optional i64 time_series_compaction_level_threshold = 1
diff --git a/regression-test/data/query_p0/system/test_table_properties.out
b/regression-test/data/query_p0/system/test_table_properties.out
index 497f3006120..8583440960d 100644
--- a/regression-test/data/query_p0/system/test_table_properties.out
+++ b/regression-test/data/query_p0/system/test_table_properties.out
@@ -35,7 +35,7 @@ internal test_table_properties_db duplicate_table
storage_page_size 65536
internal test_table_properties_db duplicate_table
store_row_column false
internal test_table_properties_db duplicate_table tde_algorithm
PLAINTEXT
internal test_table_properties_db duplicate_table
time_series_compaction_empty_rowsets_threshold 5
-internal test_table_properties_db duplicate_table
time_series_compaction_file_count_threshold 2000
+internal test_table_properties_db duplicate_table
time_series_compaction_file_count_threshold 1000
internal test_table_properties_db duplicate_table
time_series_compaction_goal_size_mbytes 1024
internal test_table_properties_db duplicate_table
time_series_compaction_level_threshold 1
internal test_table_properties_db duplicate_table
time_series_compaction_time_threshold_seconds 3600
@@ -72,7 +72,7 @@ internal test_table_properties_db listtable
storage_page_size 65536
internal test_table_properties_db listtable
store_row_column false
internal test_table_properties_db listtable tde_algorithm
PLAINTEXT
internal test_table_properties_db listtable
time_series_compaction_empty_rowsets_threshold 5
-internal test_table_properties_db listtable
time_series_compaction_file_count_threshold 2000
+internal test_table_properties_db listtable
time_series_compaction_file_count_threshold 1000
internal test_table_properties_db listtable
time_series_compaction_goal_size_mbytes 1024
internal test_table_properties_db listtable
time_series_compaction_level_threshold 1
internal test_table_properties_db listtable
time_series_compaction_time_threshold_seconds 3600
@@ -109,7 +109,7 @@ internal test_table_properties_db unique_table
storage_page_size 65536
internal test_table_properties_db unique_table
store_row_column false
internal test_table_properties_db unique_table tde_algorithm
PLAINTEXT
internal test_table_properties_db unique_table
time_series_compaction_empty_rowsets_threshold 5
-internal test_table_properties_db unique_table
time_series_compaction_file_count_threshold 2000
+internal test_table_properties_db unique_table
time_series_compaction_file_count_threshold 1000
internal test_table_properties_db unique_table
time_series_compaction_goal_size_mbytes 1024
internal test_table_properties_db unique_table
time_series_compaction_level_threshold 1
internal test_table_properties_db unique_table
time_series_compaction_time_threshold_seconds 3600
@@ -148,7 +148,7 @@ internal test_table_properties_db duplicate_table
storage_page_size 65536
internal test_table_properties_db duplicate_table
store_row_column false
internal test_table_properties_db duplicate_table tde_algorithm
PLAINTEXT
internal test_table_properties_db duplicate_table
time_series_compaction_empty_rowsets_threshold 5
-internal test_table_properties_db duplicate_table
time_series_compaction_file_count_threshold 2000
+internal test_table_properties_db duplicate_table
time_series_compaction_file_count_threshold 1000
internal test_table_properties_db duplicate_table
time_series_compaction_goal_size_mbytes 1024
internal test_table_properties_db duplicate_table
time_series_compaction_level_threshold 1
internal test_table_properties_db duplicate_table
time_series_compaction_time_threshold_seconds 3600
@@ -185,7 +185,7 @@ internal test_table_properties_db unique_table
storage_page_size 65536
internal test_table_properties_db unique_table
store_row_column false
internal test_table_properties_db unique_table tde_algorithm
PLAINTEXT
internal test_table_properties_db unique_table
time_series_compaction_empty_rowsets_threshold 5
-internal test_table_properties_db unique_table
time_series_compaction_file_count_threshold 2000
+internal test_table_properties_db unique_table
time_series_compaction_file_count_threshold 1000
internal test_table_properties_db unique_table
time_series_compaction_goal_size_mbytes 1024
internal test_table_properties_db unique_table
time_series_compaction_level_threshold 1
internal test_table_properties_db unique_table
time_series_compaction_time_threshold_seconds 3600
@@ -226,7 +226,7 @@ internal test_table_properties_db duplicate_table
storage_page_size 65536
internal test_table_properties_db duplicate_table
store_row_column false
internal test_table_properties_db duplicate_table tde_algorithm
PLAINTEXT
internal test_table_properties_db duplicate_table
time_series_compaction_empty_rowsets_threshold 5
-internal test_table_properties_db duplicate_table
time_series_compaction_file_count_threshold 2000
+internal test_table_properties_db duplicate_table
time_series_compaction_file_count_threshold 1000
internal test_table_properties_db duplicate_table
time_series_compaction_goal_size_mbytes 1024
internal test_table_properties_db duplicate_table
time_series_compaction_level_threshold 1
internal test_table_properties_db duplicate_table
time_series_compaction_time_threshold_seconds 3600
diff --git
a/regression-test/suites/compaction/test_time_series_compaction_policy.groovy
b/regression-test/suites/compaction/test_time_series_compaction_policy.groovy
index 69c8fb97fa7..7f3aa2abf81 100644
---
a/regression-test/suites/compaction/test_time_series_compaction_policy.groovy
+++
b/regression-test/suites/compaction/test_time_series_compaction_policy.groovy
@@ -36,6 +36,48 @@ suite("test_time_series_compaction_polciy", "p0") {
return rowsetCount
}
+ sql """ DROP TABLE IF EXISTS ${tableName}; """
+ sql """
+ CREATE TABLE ${tableName} (
+ `id` int(11) NULL,
+ `name` varchar(255) NULL,
+ `hobbies` text NULL,
+ `score` int(11) NULL
+ ) ENGINE=OLAP
+ DUPLICATE KEY(`id`)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(`id`) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1",
+ "disable_auto_compaction" = "true",
+ "compaction_policy" = "time_series"
+ );
+ """
+
+ for (int i = 0; i < 1005; i++) {
+ sql """ INSERT INTO ${tableName} VALUES (${i}, "andy", "andy love
apple", 100); """
+ }
+
+ def triggered_tablets = sql_return_maparray """show tablets from
${tableName}"""
+ for (tablet in triggered_tablets) {
+ def be_host = backendId_to_backendIP["${tablet.BackendId}"]
+ def be_port = backendId_to_backendHttpPort["${tablet.BackendId}"]
+ curl("POST",
"http://${be_host}:${be_port}/api/compaction/run?tablet_id=${tablet.TabletId}&compact_type=cumulative")
+ }
+
+ Thread.sleep(10000)
+ for (tablet in triggered_tablets) {
+ def be_host = backendId_to_backendIP["${tablet.BackendId}"]
+ def be_port = backendId_to_backendHttpPort["${tablet.BackendId}"]
+
+ def (exit_code, stdout, stderr) = be_get_compaction_status(be_host,
be_port, tablet.TabletId)
+ assert exit_code == 0: "get compaction status failed, exit code:
${exit_code}, stdout: ${stdout}, stderr: ${stderr}"
+ def compactionStatus = parseJson(stdout.trim())
+ logger.info("compaction status: ${compactionStatus}")
+ assert compactionStatus.status.toLowerCase() == "success": "compaction
failed, be host: ${be_host}, tablet id: ${tablet.TabletId}, status:
${compactionStatus.status}"
+ }
+ tableName = "test_time_series_compaction_polciy_2"
+
sql """ DROP TABLE IF EXISTS ${tableName}; """
sql """
CREATE TABLE ${tableName} (
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]