This is an automated email from the ASF dual-hosted git repository.
xingtanzjr 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 7970bb0fbf [IOTDB-2919] Change regionCleaner work interval from 5s to
300s (#6016)
7970bb0fbf is described below
commit 7970bb0fbf7796280f132168b964674ea4b6647a
Author: cmlmakahts <[email protected]>
AuthorDate: Wed May 25 20:00:59 2022 +0800
[IOTDB-2919] Change regionCleaner work interval from 5s to 300s (#6016)
---
.../iotdb/confignode/manager/PartitionManager.java | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
index 03822abecc..a969a5ee62 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
@@ -69,17 +69,22 @@ public class PartitionManager {
private final Manager configManager;
private final PartitionInfo partitionInfo;
+ private static final int REGION_CLEANER_WORK_INTERVAL = 300;
+ private static final int REGION_CLEANER_WORK_INITIAL_DELAY = 10;
private SeriesPartitionExecutor executor;
-
private final ScheduledExecutorService regionCleaner;
public PartitionManager(Manager configManager, PartitionInfo partitionInfo) {
this.configManager = configManager;
this.partitionInfo = partitionInfo;
this.regionCleaner =
-
IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor("IoTDB-StorageGroup-Cleaner");
- regionCleaner.scheduleAtFixedRate(this::clearDeletedStorageGroup, 10, 5,
TimeUnit.SECONDS);
+
IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor("IoTDB-Region-Cleaner");
+ regionCleaner.scheduleAtFixedRate(
+ this::clearDeletedRegions,
+ REGION_CLEANER_WORK_INITIAL_DELAY,
+ REGION_CLEANER_WORK_INTERVAL,
+ TimeUnit.SECONDS);
setSeriesPartitionExecutor();
}
@@ -388,7 +393,11 @@ public class PartitionManager {
getConsensusManager().write(preDeleteStorageGroupReq);
}
- private void clearDeletedStorageGroup() {
+ /**
+ * Called by {@link PartitionManager#regionCleaner} Delete regions of
logical deleted storage
+ * groups periodically.
+ */
+ private void clearDeletedRegions() {
if (getConsensusManager().isLeader()) {
final Set<TRegionReplicaSet> deletedRegionSet =
partitionInfo.getDeletedRegionSet();
if (!deletedRegionSet.isEmpty()) {