Option 3., of course, is simple and safe. However, a POSIX-compliant parallel file system with performance sufficient for anyone to actually use it usually uses option 1 in conjunction with some more or less involved mechanism to avoid conflicts when, for example, several clients cache the same file.
As the saying goes, "in Computer Science, there are only two difficult things: the invalidity of the cache, naming, and errors" one after another. "
If the file system needs to be POSIX compatible, you need to go on to study the semantics of POSIX fs and find how fs supports them when you get good performance (alternatively, what parts of the POSIX semantics does it skip, a la NFS), which makes it wrong, interesting that the semantics of POSIX fs goes back to 1970, but hardly knows how to support network file systems.
I donβt know about pvfs2 specifically, but as a rule, in order to comply with POSIX and provide decent performance, option 1 can be used together with some kind of cache coherence protocol (for example, Luster). For fsync (), the data must actually be transferred to the server and committed to stable storage on the server (disks or write cache with backup) before fsync () returns. And, of course, the client has some restriction on the number of dirty pages, after which it blocks further writing () to the file until some are transferred to the server.
source share