ssdf dfdfd
2015-May-24 03:31 UTC
[Gluster-users] Can not rename(move) a file in java.io.tmpDir to a mounted gluster volume
gluster version: 3.6.2 from ppa:gluster/glusterfs-3.6 os: ubuntu 14.04 The gluster volume is mounted at '/nfs_gluster'. A jave http server takes uploaded files in directory '/tmp' and rename (move) them to a subdirectory in the volume at '/nfs_gluster/data'. Here is the java code UPLOADED_FILE.renameTo(new File('/nfs_gluster/data', NEW_FILE_NAME); The java program runs without any error or exception, but no file was moved: there was nothing in '/nfs_gluster/data'. However, if I set java to use a tmp directory that is also part of the mounted volume, everything works as expected: the uploaded files was moved to '/nfs_gluster'. ie, System.set("java.io.tmpDir", "/nfs_gluster") make everything work. I believe this is a bug, probably relate to http://www.gluster.org/pipermail/gluster-users.old/2015-January/020194.html Cheers David
Rajesh Joseph
2015-May-25 06:32 UTC
[Gluster-users] Can not rename(move) a file in java.io.tmpDir to a mounted gluster volume
----- Original Message -----> From: "ssdf dfdfd" <kkyspy at gmail.com> > To: gluster-users at gluster.org > Sent: Sunday, May 24, 2015 9:01:41 AM > Subject: [Gluster-users] Can not rename(move) a file in java.io.tmpDir to a mounted gluster volume > > gluster version: 3.6.2 from ppa:gluster/glusterfs-3.6 > os: ubuntu 14.04 > > The gluster volume is mounted at '/nfs_gluster'. A jave http server > takes uploaded files in directory '/tmp' and rename (move) them to a > subdirectory in the volume at '/nfs_gluster/data'. Here is the java > code > > UPLOADED_FILE.renameTo(new File('/nfs_gluster/data', NEW_FILE_NAME); > > The java program runs without any error or exception, but no file was > moved: there was nothing in '/nfs_gluster/data'. > > However, if I set java to use a tmp directory that is also part of the > mounted volume, everything works as expected: the uploaded files was > moved to '/nfs_gluster'. ie, > > System.set("java.io.tmpDir", "/nfs_gluster") > > make everything work. > > I believe this is a bug, probably relate to > > http://www.gluster.org/pipermail/gluster-users.old/2015-January/020194.htmlIs it something to do with cross file-system rename. I am not familiar with Java but we encountered similar issue with python. See http://bugs.python.org/issue212317. A quick google search gave me below mention link: http://stackoverflow.com/questions/7087743/how-to-rename-a-file-to-another-file-system> > Cheers > David > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://www.gluster.org/mailman/listinfo/gluster-users >