sofastack / sofa-jraft

A production-grade java implementation of RAFT consensus algorithm.
https://www.sofastack.tech/projects/sofa-jraft/
Apache License 2.0
3.57k stars 1.14k forks source link

Invalid cross-device link #966

Closed qiujiayu closed 1 year ago

qiujiayu commented 1 year ago

Describe the bug

Suppressed: java.nio.file.AtomicMoveNotSupportedException: /home/xxx -> /opt/xxxx/snapshot_42621: Invalid cross-device link at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:414) at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:266) at java.base/java.nio.file.Files.move(Files.java:1432) at com.alipay.sofa.jraft.util.Utils.atomicMoveFile(Utils.java:375)

Environment

killme2008 commented 1 year ago

It's expected, I don't think it's a bug.

qiujiayu commented 1 year ago

It's expected, I don't think it's a bug.

But we hope to support this feature.

sunng87 commented 1 year ago

It's expected, I don't think it's a bug.

But we hope to support this feature.

It will break the promise of API, and impact the correctness of jraft. I think it's not a good idea to do this.

fengjiachun commented 1 year ago

There is no need to do this within the jraft framework. After onSnapshotSave is completed, the user-level code can implement the cross device copy.