[kwlug-disc] Accessing recently-written NFS files
Adam Glauser
adamglauser at gmail.com
Mon Dec 12 17:45:04 EST 2022
I've got a bit of a head-scratcher on my hands.
I have a filesystem on my application's host (Oracle/RH Linux 7) that is
mounted via NFS. I believe the FS is served by a Windows machine.
If I do something like this, everything is fine
$ for i in {1..100};
do
head -c 10 </dev/urandom >"/nfs_share/tmp/test_file${i}";
done && find /nfs_share/tmp/ -name test_file* -exec mv {}
/nfs_share/final_location
\;
However, if I bump up the file size to 10K, suddenly they all fail to mv
with "Permission denied" errors. Waiting some time and retrying the 'mv'
causes it to complete successfully.
I think this means that there is some kind of client-side caching
happening, so that the file appears to be written, while NFS is still
working away on transferring it to the storage location. Trying to unlink
the file before the cache is emptied is disallowed, presumably to avoid
data loss.
Am I headed in the right direction by trying to delve into the details of
NFS caching and file locking? Any other avenues that someone can suggest?
Thanks,
Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20221212/85c03ab4/attachment.htm>
More information about the kwlug-disc
mailing list