This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new fd831b7d964 Random schedule compaction of bound data regions in one
compaction schedule worker (#12167)
fd831b7d964 is described below
commit fd831b7d964093a932d0437fa7ea8b35315eb5b7
Author: shuwenwei <[email protected]>
AuthorDate: Thu Mar 14 09:50:01 2024 +0800
Random schedule compaction of bound data regions in one compaction schedule
worker (#12167)
---
.../src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java | 2 +-
.../compaction/schedule/CompactionScheduleTaskWorker.java | 7 ++++++-
.../src/assembly/resources/conf/iotdb-common.properties | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index 7bd8754fa16..08420029988 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -523,7 +523,7 @@ public class IoTDBConfig {
private boolean enableTsFileValidation = false;
/** The size of candidate compaction task queue. */
- private int candidateCompactionTaskQueueSize = 50;
+ private int candidateCompactionTaskQueueSize = 200;
/**
* When the size of the mods file corresponding to TsFile exceeds this
value, inner compaction
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/schedule/CompactionScheduleTaskWorker.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/schedule/CompactionScheduleTaskWorker.java
index b6b438e1b80..e3f8318c63f 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/schedule/CompactionScheduleTaskWorker.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/schedule/CompactionScheduleTaskWorker.java
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
@@ -53,11 +54,15 @@ public class CompactionScheduleTaskWorker implements
Callable<Void> {
continue;
}
List<DataRegion> dataRegionListSnapshot = new
ArrayList<>(dataRegionList);
+ List<DataRegion> dataRegionsToScheduleCompaction = new ArrayList<>();
for (int i = 0; i < dataRegionListSnapshot.size(); i++) {
if (i % workerNum != workerId) {
continue;
}
- DataRegion dataRegion = dataRegionListSnapshot.get(i);
+ dataRegionsToScheduleCompaction.add(dataRegionListSnapshot.get(i));
+ }
+ Collections.shuffle(dataRegionsToScheduleCompaction);
+ for (DataRegion dataRegion : dataRegionsToScheduleCompaction) {
if (Thread.interrupted()) {
throw new InterruptedException();
}
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 eb959726c5c..1a626c25aa2 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
@@ -586,7 +586,7 @@ data_replication_factor=1
# The size of candidate compaction task queue.
# Datatype: int
-# candidate_compaction_task_queue_size = 50
+# candidate_compaction_task_queue_size = 200
# This parameter is used in two places:
# 1. The target tsfile size of inner space compaction.