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 <[email protected]>
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;

Reply via email to