You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2023/07/19 11:11:07 UTC

[iotdb] 01/01: Make the candidate size of seq tsfile in cross space compaction will be smaller than target_compaction_file_size * 1.5.

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a commit to branch modify_cross_selector
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 014b60b2a67e501e3c089438bde3ad075e6d1516
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Wed Jul 19 19:10:51 2023 +0800

    Make the candidate size of seq tsfile in cross space compaction will be smaller than target_compaction_file_size * 1.5.
---
 .../selector/impl/RewriteCrossSpaceCompactionSelector.java           | 2 +-
 .../node-commons/src/assembly/resources/conf/iotdb-common.properties | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/impl/RewriteCrossSpaceCompactionSelector.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/impl/RewriteCrossSpaceCompactionSelector.java
index e9367bb31f1..b461607483a 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/impl/RewriteCrossSpaceCompactionSelector.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/impl/RewriteCrossSpaceCompactionSelector.java
@@ -237,7 +237,7 @@ public class RewriteCrossSpaceCompactionSelector implements ICrossSpaceSelector
 
     long totalFileSize = unseqFile.getTsFileSize();
     for (TsFileResource f : seqFiles) {
-      if (f.getTsFileSize() >= config.getTargetCompactionFileSize()) {
+      if (f.getTsFileSize() >= config.getTargetCompactionFileSize() * 1.5) {
         // to avoid serious write amplification caused by cross space compaction, we restrict that
         // seq files are no longer be compacted when the size reaches the threshold.
         return false;
diff --git a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 73178ed0bf5..0a800ba9a56 100644
--- a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -593,7 +593,10 @@ cluster_name=defaultCluster
 # Datatype: int
 # candidate_compaction_task_queue_size = 50
 
-# The target tsfile size in compaction
+# This parameter is used in two places:
+# 1. The target tsfile size of inner space compaction.
+# 2. The candidate size of seq tsfile in cross space compaction will be smaller than target_compaction_file_size * 1.5.
+# In most cases, the target file size of cross compaction won't exceed this threshold, and if it does, it will not be much larger than it.
 # default is 2GB
 # Datatype: long, Unit: byte
 # target_compaction_file_size=2147483648