Re: mount -o async - is it safe?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shane Wright <shane(dot)wright(at)edigitalresearch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: mount -o async - is it safe?
Date: 2006-01-20 06:00:44
Message-ID: 13321.1137736844@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Shane Wright <shane(dot)wright(at)edigitalresearch(dot)com> writes:
> If we turn sync off, surely PostgreSQL keeps the data consistent, ext3
> journalling keeps the filesystem clean [assuming other mount options left at
> defaults], and then everything should be ok with either a server crash, power
> failure, storage failure, whatever. right?

I checked around with some of Red Hat's kernel folk, and the bottom line
seems to be that it's OK as long as you trust the hardware:

:> Question is, can fsync(2) be trusted to behave properly, ie, not return
:> until all writes are down to disk, if the SAN is mounted -o async ?
:
: async is the default, which is the whole point of having things like
: fsync, fdatasync, O_DIRECT, etc. You can trust fsync as far as you can
: trust the hardware. The call will not return until the SAN says the
: data has been written.
:
: In reality, the SAN is probably buffering these writes (possibly into
: SRAM or battery-backed RAM), and the disks are probably buffering them
: again, but you've got redundant power supplies and UPSs, right?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dick Kniep 2006-01-20 06:56:38 Connected user in a triggerfunction
Previous Message Michael Fuhr 2006-01-20 03:42:44 Re: auto increment within a compound key