We have a system producing new files on an NFS share (I believe the provider is NetApp). Our applications are written in Java. The Java spec says that FileSystem moves are atomic, but not sure if moves on an NFS drive is similarly atomic.
The 'producer' app:
- Writes a file to /my/nfs/share/temp/
- Then moves the file from /my/nfs/share/temp/ to /my/nfs/share/saved/
(The files will always have unique names, we use GUIDs in both the temp and saved filenames.)
The 'consumer' app:
- Looks for new files in: /my/nfs/share/saved/
- If a new file is found, it reads it.
There is only one 'producer' app instance.
My question is: will the 'consumer' app always see a fully written file. Or is it possible for a partially written file, or an empty file, to be visible to the 'consumer'.
Any help would be appreciated.