How Do I enable Safe Asynchronous Write With NFS?
The NFSv3 documentation talks alot about the concept of "safe asynchronous writes" (last bullet of A1):
http://nfs.sourceforge.net/#section_a
This is NOT referring to the sync/async option in the server exports file (as the async option in the exports file is NOT safe). As I understand it, safe asynchronous writes is a hybrid between the sync/async exports option. It allows for a server to reply back without flushing to stable storage immediately, but the client will not remove the write request from cache until it has received confirmation that it has been committed to stable storage (and also detects if the server looses power/reboots). I believe that this option is set on the client side, but I have not come across any documentation that shows how to do this. Any ideas?
Solution 1:
This is simply a series of WRITE calls with COMMIT or WRITE with sync. The behavior is controlled by application write + fsync or when VM decided to recycle memory pages. The exports options async/sync can enforce server behavior, e.g. server may always sync the data even if client didn't ask for it. Check https://www.rfc-editor.org/rfc/rfc1813#section-3.3.7 and https://www.rfc-editor.org/rfc/rfc1813#section-3.3.21 for more details.