You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2024/03/12 01:34:51 UTC
(iotdb) branch master updated: fix StorageEngine recover slowly (#12151)
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 48c11629c56 fix StorageEngine recover slowly (#12151)
48c11629c56 is described below
commit 48c11629c56abf310a08190ee5539ba5cfd89454
Author: shuwenwei <55...@users.noreply.github.com>
AuthorDate: Tue Mar 12 09:34:45 2024 +0800
fix StorageEngine recover slowly (#12151)
---
.../compaction/schedule/CompactionScheduleTaskWorker.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 6c9d68b3c6e..b6b438e1b80 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
@@ -20,6 +20,7 @@
package org.apache.iotdb.db.storageengine.dataregion.compaction.schedule;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.storageengine.StorageEngine;
import org.apache.iotdb.db.storageengine.dataregion.DataRegion;
import org.slf4j.Logger;
@@ -47,6 +48,10 @@ public class CompactionScheduleTaskWorker implements Callable<Void> {
public Void call() {
while (true) {
try {
+ Thread.sleep(IoTDBDescriptor.getInstance().getConfig().getCompactionScheduleIntervalInMs());
+ if (!StorageEngine.getInstance().isAllSgReady()) {
+ continue;
+ }
List<DataRegion> dataRegionListSnapshot = new ArrayList<>(dataRegionList);
for (int i = 0; i < dataRegionListSnapshot.size(); i++) {
if (i % workerNum != workerId) {
@@ -58,7 +63,6 @@ public class CompactionScheduleTaskWorker implements Callable<Void> {
}
dataRegion.executeCompaction();
}
- Thread.sleep(IoTDBDescriptor.getInstance().getConfig().getCompactionScheduleIntervalInMs());
} catch (InterruptedException ignored) {
logger.info(
"[CompactionScheduleTaskWorker-{}] compaction schedule is interrupted", workerId);