Skip to content

Commit f8da5bd

Browse files
branch-3.1: [chore](cold) add a score threshold for cold data compaction #55333 (#57217)
Cherry-picked from #55333 Co-authored-by: Yongqiang YANG <[email protected]>
1 parent 514a1cc commit f8da5bd

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

be/src/common/config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,7 @@ DEFINE_mInt32(remove_unused_remote_files_interval_sec, "21600"); // 6h
10171017
DEFINE_mInt32(confirm_unused_remote_files_interval_sec, "60");
10181018
DEFINE_Int32(cold_data_compaction_thread_num, "2");
10191019
DEFINE_mInt32(cold_data_compaction_interval_sec, "1800");
1020+
DEFINE_mInt32(cold_data_compaction_score_threshold, "100");
10201021

10211022
DEFINE_String(tmp_file_dir, "tmp");
10221023

be/src/common/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ DECLARE_mInt32(remove_unused_remote_files_interval_sec); // 6h
10581058
DECLARE_mInt32(confirm_unused_remote_files_interval_sec);
10591059
DECLARE_Int32(cold_data_compaction_thread_num);
10601060
DECLARE_mInt32(cold_data_compaction_interval_sec);
1061+
DECLARE_mInt32(cold_data_compaction_score_threshold);
10611062

10621063
DECLARE_Int32(min_s3_file_system_thread_num);
10631064
DECLARE_Int32(max_s3_file_system_thread_num);

be/src/olap/olap_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ void StorageEngine::_cold_data_compaction_producer_callback() {
15491549
for (auto& t : tablets) {
15501550
if (t->replica_id() == t->cooldown_conf_unlocked().cooldown_replica_id) {
15511551
auto score = t->calc_cold_data_compaction_score();
1552-
if (score < 4) {
1552+
if (score < config::cold_data_compaction_score_threshold) {
15531553
continue;
15541554
}
15551555
tablet_to_compact.emplace_back(t, score);

regression-test/suites/cold_heat_separation/cold_data_compaction.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ suite("test_cold_data_compaction", "nonConcurrent") {
3737
}
3838
}
3939

40+
def custoBeConfig = [
41+
cold_data_compaction_score_threshold : 4
42+
]
43+
44+
setBeConfigTemporary(custoBeConfig) {
4045
String suffix = UUID.randomUUID().hashCode().abs().toString()
4146
String s3Prefix = "regression/cold_data_compaction"
4247
multi_sql """
@@ -152,4 +157,5 @@ suite("test_cold_data_compaction", "nonConcurrent") {
152157
logger.info("after drop t_recycle_in_s3, remote file number is ${filesAfterDrop.size()}")
153158
return filesAfterDrop.size() == 0
154159
})
160+
}
155161
}

0 commit comments

Comments
 (0)