Improve message in case of failure due to move operation

78 views
Skip to first unread message

Marco Quaranta

unread,
Sep 23, 2014, 11:31:41 AM9/23/14
to xad...@googlegroups.com
Hello,
I receive an error when moving a file using XADiskBasicIOOperations.moveFile() between different file systems. 
This is my stacktrace:

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







Nitin Verma

unread,
Sep 28, 2014, 4:24:18 AM9/28/14
to xad...@googlegroups.com
Hi Marco,

Thanks for your post.

I need a little clarification. If xadisk is not able to rename, it tries the move-and-delete workaround if the source is a file. So, this workaround is already implemented. Is the workaround not working successfully on your environment (and so you saw the above error), or was the object being renamed a directory, not a file?

Thanks,
Nitin

Nitin Verma

unread,
Sep 28, 2014, 4:26:07 AM9/28/14
to xad...@googlegroups.com
Sorry, I wrongly wrote move-and-delete instead of copy-and-delete in my above message.

Marco Quaranta

unread,
Sep 29, 2014, 4:25:30 AM9/29/14
to xad...@googlegroups.com
Hi Nitin, 
I'm processing folder not files...

Thanks,
Marco

Nitin Verma

unread,
Oct 6, 2014, 1:59:41 PM10/6/14
to xad...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages