6 Feb
2007
6 Feb
'07
10:10 p.m.
On Tue, 2007-02-06 at 11:55 -0800, Dan Price wrote:
Out of curiosity, why do you feel that the other fsyncs are more beneficial? At least on ZFS, you don't have the problem of stale dirty data sitting around in memory (and not on the platter) for long periods of time.
Well it's not a real problem in many cases. Its only purpose is to prevent problems that could happen in case the computer dies before the data was written to disk. Dovecot uses it in two situations:
- When mail is saved, it's fsync()ed before the client is told that the save succeeded. This is probably more important with deliver than in IMAP APPEND, because deliver would lose an incoming mail that was never even seen by the user.
Actually I'm missing one fsync() here with maildir. I should open the new/ directory and fsync() it too. Currently I'm just fsyncing the individual maildir files.
- There are several places in Dovecot where it updates the file by first writing it to a temporary file, then fsyncs it, then rename()s it over the destination file. The point here is that in case of a crash it doesn't leave broken files lying around.
Looks like I'm not fsyncing enough in this case either. subscriptions file and maildir-keywords file should be fsynced.