I receive an error when moving a file using XADiskBasicIOOperations.moveFile() between different file systems.
org.xadisk.filesystem.exceptions.TransactionFailedException: The transaction has failed and has not completed commit or rollback. The file-system data operated on by the transaction may be in inconsistent state. This exception is not expected to occur in general, and indicates a severe problem.
at org.xadisk.filesystem.NativeSession.commit(NativeSession.java:750) ~[xadisk-1.2.2.4.jar:na]
at org.xadisk.filesystem.NativeSession.commit(NativeSession.java:1348) ~[xadisk-1.2.2.4.jar:na]
...........
Caused by: java.io.IOException: The i/o operation could not be completed for the file/directory with path [/PATH_OF_AN_NFS_MOUNT/] due to an unknown reason.
at org.xadisk.filesystem.utilities.FileIOUtility.doGCBeforeRetry(FileIOUtility.java:141) ~[xadisk-1.2.2.4.jar:na]
at org.xadisk.filesystem.utilities.FileIOUtility.renameTo(FileIOUtility.java:27) ~[xadisk-1.2.2.4.jar:na]
at org.xadisk.filesystem.DurableDiskSession.renameTo(DurableDiskSession.java:146) ~[xadisk-1.2.2.4.jar:na]
at org.xadisk.filesystem.NativeSession.commitMove(NativeSession.java:935) ~[xadisk-1.2.2.4.jar:na]
at org.xadisk.filesystem.NativeSession.commit(NativeSession.java:721) ~[xadisk-1.2.2.4.jar:na]
... 12 common frames omitted
The cause of the problem is File.renameTo() API that (at least in linux env) return always false when operating on different device/fs.
Apart from the copy/delete solution, I will suggest to improve the message so that it could be more helpful. For example: The i/o operation could not be completed for the file/directory with path [/PATH_OF_AN_NFS_MOUNT/] due to an unknown reason. Sometimes move doesn't work for operation involving two different file systems, please try copy/delete approach.
Thanks,
Marco