You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2024/08/08 03:52:47 UTC
(iotdb) branch master updated: Handle exception when the WAL initializtion is interrupted (#13102)
This is an automated email from the ASF dual-hosted git repository.
jiangtian 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 45021a6f898 Handle exception when the WAL initializtion is interrupted (#13102)
45021a6f898 is described below
commit 45021a6f89895c554cbe03bb53e5e608c76d5ec9
Author: Jiang Tian <jt...@163.com>
AuthorDate: Thu Aug 8 11:52:41 2024 +0800
Handle exception when the WAL initializtion is interrupted (#13102)
---
.../db/storageengine/dataregion/memtable/TsFileProcessor.java | 10 ++++++----
.../dataregion/wal/allocation/FirstCreateStrategy.java | 7 ++++---
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
index ae974b17519..f30dd1799d4 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java
@@ -296,10 +296,11 @@ public class TsFileProcessor {
}
} catch (Exception e) {
rollbackMemoryInfo(memIncrements);
+ logger.warn("Exception during wal flush", e);
throw new WriteProcessException(
String.format(
- "%s: %s write WAL failed",
- storageGroupName, tsFileResource.getTsFile().getAbsolutePath()),
+ "%s: %s write WAL failed: %s",
+ storageGroupName, tsFileResource.getTsFile().getAbsolutePath(), e.getMessage()),
e);
} finally {
// recordScheduleWalCost
@@ -370,10 +371,11 @@ public class TsFileProcessor {
}
} catch (Exception e) {
rollbackMemoryInfo(memIncrements);
+ logger.warn("Exception during wal flush", e);
throw new WriteProcessException(
String.format(
- "%s: %s write WAL failed",
- storageGroupName, tsFileResource.getTsFile().getAbsolutePath()),
+ "%s: %s write WAL failed: %s",
+ storageGroupName, tsFileResource.getTsFile().getAbsolutePath(), e.getMessage()),
e);
} finally {
// recordScheduleWalCost
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/FirstCreateStrategy.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/FirstCreateStrategy.java
index 75b3cb88788..42064a3294b 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/FirstCreateStrategy.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/FirstCreateStrategy.java
@@ -51,8 +51,9 @@ public class FirstCreateStrategy extends AbstractNodeAllocationStrategy {
public IWALNode applyForWALNode(String applicantUniqueId) {
nodesLock.lock();
try {
- if (!identifier2Nodes.containsKey(applicantUniqueId)) {
- IWALNode walNode = createWALNode(applicantUniqueId);
+ IWALNode walNode = identifier2Nodes.get(applicantUniqueId);
+ if (walNode == null) {
+ walNode = createWALNode(applicantUniqueId);
if (walNode instanceof WALNode) {
// avoid deletion
walNode.setSafelyDeletedSearchIndex(
@@ -61,7 +62,7 @@ public class FirstCreateStrategy extends AbstractNodeAllocationStrategy {
}
}
- return identifier2Nodes.get(applicantUniqueId);
+ return walNode;
} finally {
nodesLock.unlock();
}