You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2023/04/26 00:39:07 UTC
[iotdb] branch rel/1.1 updated: [To rel/1.1][IOTDB-5183] Use default snapshot installation path for confignode & schema region
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rel/1.1
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.1 by this push:
new 4e5f0977cf [To rel/1.1][IOTDB-5183] Use default snapshot installation path for confignode & schema region
4e5f0977cf is described below
commit 4e5f0977cf639e4693112187ff99f5551385a292
Author: William Song <48...@users.noreply.github.com>
AuthorDate: Wed Apr 26 08:39:01 2023 +0800
[To rel/1.1][IOTDB-5183] Use default snapshot installation path for confignode & schema region
---
.../java/org/apache/iotdb/consensus/ratis/SnapshotStorage.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/SnapshotStorage.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/SnapshotStorage.java
index 9f9d281110..f19faedf2e 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/SnapshotStorage.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/SnapshotStorage.java
@@ -124,7 +124,13 @@ public class SnapshotStorage implements StateMachineStorage {
}
FileInfo fileInfo = null;
try {
- fileInfo = new FileInfo(file.toRealPath(), null);
+ if (getSnapshotDir() == null) {
+ // for regions that place the snapshot in default sm folder, use relative path
+ fileInfo = new FileInfo(file, null);
+ } else {
+ // for regions that have a separate snapshot installation path, use absolute path
+ fileInfo = new FileInfo(file.toRealPath(), null);
+ }
} catch (IOException e) {
logger.warn("{} cannot resolve real path of {} due to {}", this, file, e);
return null;