This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.2 by this push:
new 76b99f29c38 [To rel/1.2] Flush previous time partition memtable by wal
(#10221)
76b99f29c38 is described below
commit 76b99f29c38b2f438ee469c305513e379a41894d
Author: Haonan <[email protected]>
AuthorDate: Tue Jun 20 11:39:35 2023 +0800
[To rel/1.2] Flush previous time partition memtable by wal (#10221)
---
server/src/main/java/org/apache/iotdb/db/wal/WALManager.java | 2 +-
.../src/main/java/org/apache/iotdb/db/wal/node/WALNode.java | 12 +++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
b/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
index 36db197dae5..d041114fde9 100644
--- a/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/wal/WALManager.java
@@ -202,7 +202,7 @@ public class WALManager implements IService {
}
public boolean shouldThrottle() {
- return getTotalDiskUsage() >= config.getThrottleThreshold();
+ return getTotalDiskUsage() >= config.getThrottleThreshold() * 0.8;
}
public long getTotalDiskUsage() {
diff --git a/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
b/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
index 4891062e892..8a040a980f1 100644
--- a/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/wal/node/WALNode.java
@@ -240,13 +240,7 @@ public class WALNode implements IWALNode {
identifier,
firstValidVersionId,
safelyDeletedSearchIndex);
- boolean pinnedByIoTConsensus = deleteOutdatedFiles();
- if (pinnedByIoTConsensus) {
- logger.debug(
- "Cannot delete wal files for wal node-{} because of wal files are
pinned by IoTConsensus.",
- identifier);
- return;
- }
+ deleteOutdatedFiles();
// calculate effective information ratio
long costOfActiveMemTables =
checkpointManager.getTotalCostOfActiveMemTables();
@@ -277,6 +271,10 @@ public class WALNode implements IWALNode {
config.getWalMinEffectiveInfoRatio());
boolean isSuccess = snapshotOrFlushMemTable();
if (isSuccess && recursionTime < MAX_RECURSION_TIME) {
+ // wal is used to search, cannot optimize files deletion
+ if (safelyDeletedSearchIndex != DEFAULT_SAFELY_DELETED_SEARCH_INDEX) {
+ return;
+ }
recursionTime++;
run();
}