> -----Original Message----- > From: [email protected] [mailto:rsyslog- > [email protected]] On Behalf Of Aaron Wiebe > Sent: Monday, June 08, 2009 6:12 PM > To: rsyslog-users > Subject: Re: [rsyslog] ultra-reliable disk files fsync vs. fdatasync > > On Mon, Jun 8, 2009 at 12:09 PM, <[email protected]> wrote: > >> I am working on the ultra-reliable file writing capability. I have > revisited > >> the doc and am considering fsync() vs. fdatasync(). From the man pages, it > >> looks like fdatasync() is sufficient if I just need to ensure that any data > >> written can also be read. The advantage of fdatasync() is that it is > somewhat > >> faster as not all meta data is necessarily written. > >> > >> I would appreciate if someone could comment on this issue. > > > > my understanding is that if you are growing the file you need to do a > > fsync of the directory, but if you are re-writing part of an already > > allocated file fdatasync is the better thing to use. > > While following this path, it would also be a good idea to check NFS > compatibility, as I would bet that is a common configuration. NFS can > have its own unique quirks....
>From what I have seen during my research, I would expect that NFS does not always correctly fsync(). It seems to depend a lot on the actual implementation, maybe version of it. What I currently do is ignore an error during fsync() (fdatasync to be more precise). The reason is that there is not much I could do if I see the error. Aborting the run would probably be much more fatal than ignoring the error. The same goes if the fsync() for the directory fails or if I can not open the directory. I would assume that if a truly reliable system is requested, local disks must be used. Comments welcome, Rainer _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com

