From: | Jerome Vouillon <vouillon(at)saul(dot)cis(dot)upenn(dot)edu> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: WAL and commit_delay |
Date: | 2001-02-18 16:59:24 |
Message-ID: | d3z1ysw0vwz.fsf@saul.cis.upenn.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> The implication is that the only thing you can lose after fdatasync is
> the highly-inessential file mod time. However, I have been told that
> on some implementations, fdatasync only flushes data blocks, and never
> writes the inode or indirect blocks. That would mean that if you had
> allocated new disk space to the file, fdatasync would not guarantee
> that that allocation was reflected on disk. This is the reason for
> preallocating the WAL log file (and doing a full fsync *at that time*).
> Then you know the inode block pointers and indirect blocks are down
> on disk, and so fdatasync is sufficient even if you have the cheesy
> version of fdatasync.
Actually, there is also a performance reason. Indeed, fdatasync would
not perform any better than fsync if the log file was not
preallocated: the file length would change each time a record is
appended, and therefore the inode would have to be updated.
-- Jerome
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-02-18 17:01:25 | Re: Re: WAL and commit_delay |
Previous Message | Larry Rosenman | 2001-02-18 16:56:10 | Re: Re: WAL and commit_delay |