Re: fsync = true beneficial on ext3?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, pgsql-general(at)postgresql(dot)org
Subject: Re: fsync = true beneficial on ext3?
Date: 2004-02-09 05:22:31
Message-ID: 9543.1076304151@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> My problem is that journalling works on a per-file basis. ie, the data for a
> file is written before that file's metadata. However, the fsync is used for
> the WAL segments and if you can't guarentee the WAL will hit the disk before
> the data segments (different files), you're stuffed I think.

> Or maybe WAL is not that sensitive to that kind of reordering. Maybe it only
> depends on the WAL being consistant.

The entire *point* of WAL is that WAL entries must hit disk before any
of the data-file changes they describe (that's why it's called write
AHEAD log). Without this you can't use WAL replay to ensure the data
files are brought to a fully consistent state. So yes, we do have to
have cross-file write ordering guarantees. fsync is a pretty blunt tool
for enforcing cross-file write ordering, but it's the only one
available...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Garamond 2004-02-09 05:27:06 query progress indicator
Previous Message David Garamond 2004-02-09 05:06:41 disallowing multiple NULLs in a unique constraint