This is an automated email from the ASF dual-hosted git repository.
jackietien 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 e1103a96d6 [IOTDB-5183] Use default snapshot installation path for
confignode & schema region
e1103a96d6 is described below
commit e1103a96d66bb840f8fad558ad8c991aeac9fc4a
Author: William Song <[email protected]>
AuthorDate: Tue Apr 25 20:22:37 2023 +0800
[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;