Re: disaster recovery

From: Marco Colombo <marco(at)esi(dot)it>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alex Satrapa <alex(at)lintelsys(dot)com(dot)au>, Jason Tesser <JTesser(at)nbbc(dot)edu>, "Pgsql (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: disaster recovery
Date: 2003-11-27 20:04:32
Message-ID: Pine.LNX.4.44.0311272045290.25502-100000@Megathlon.ESI
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 27 Nov 2003, Doug McNaught wrote:

> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> > Doug McNaught <doug(at)mcnaught(dot)org> writes:
> >> Alex Satrapa <alex(at)lintelsys(dot)com(dot)au> writes:
> >>> 1) Under Linux, if you have the file system containing the WAL mounted
> >>> with asynchronous writes, "all bets are off".
> >> ...
> >> Even with ext2, WAL files are preallocated and PG calls fsync() after
> >> writing, so in practice it's not likely to cause problems.
> >
> > Um. I took the reference to "mounted with async write" to mean a
> > soft-mounted NFS filesystem. It does not matter which OS you think is
> > the one true OS --- running a database over NFS is the act of someone
> > with a death wish. But, yeah, soft-mounted NFS is a particularly
> > malevolent variety ...
>
> I took it as a garbled understanding of the "Linux does async metadata
> updates" criticism. Which is true for ext2, but was never the
> show-stopper some BSD-ers wanted it to be. :)

And it's not file metadata, it's directory data. Metadata (inode
data) is synced, even in ext2, AFAIK.

Quoting the man page:
fsync copies all in-core parts of a file to disk, and
waits until the device reports that all parts are on sta-
ble storage. It also updates metadata stat information.
It does not necessarily ensure that the entry in the
directory containing the file has also reached disk. For
that an explicit fsync on the file descriptor of the
directory is also needed

For WALs, this is perfectly fine. It can be a problem for those
applications that do a lot of renames and relay on those as
sync/locking mechanisms (think of mail spoolers).

.TM.
--
____/ ____/ /
/ / / Marco Colombo
___/ ___ / / Technical Manager
/ / / ESI s.r.l.
_____/ _____/ _/ Colombo(at)ESI(dot)it

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Benoit 2003-11-27 20:18:02 Re: Postgresql on file system EXT2 or EXT3
Previous Message Christopher Browne 2003-11-27 19:50:02 Re: 7.3.4 and 7.4 ORDER in queries