Re: no universally correct setting for fsync

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: no universally correct setting for fsync
Date: 2010-05-07 14:48:53
Message-ID: 4BE3E205020000250003138F@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:

> I think the critical question is really whether you are prepared
> to lose your database.

Precisely; and the docs don't make that at all clear. They mention
the possibility of database corruption, but downplay it:

| When fsync is disabled, the operating system is allowed to do its
| best in buffering, ordering, and delaying writes. This can result
| in significantly improved performance. However, if the system
| crashes, the results of the last few committed transactions might
| be lost in part or whole. In the worst case, unrecoverable data
| corruption might occur.

> [valid use case for fsync=off]
>
> So I think its true that there is no universally right answer.
> Maybe the criteria mentioned in the last para need tweaking some,
> though.

I think it goes beyond "tweaking" -- I think we should have a bald
statement like "don't turn this off unless you're OK with losing the
entire contents of the database cluster." A brief listing of some
cases where that is OK might be illustrative.

I never meant to suggest any statement in that section is factually
wrong; it's just all too rosy, leading people to believe it's no big
deal to turn it off.

-Kevin

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Josh Berkus 2010-05-07 17:56:13 Re: no universally correct setting for fsync
Previous Message Andrew Dunstan 2010-05-07 14:38:47 Re: no universally correct setting for fsync

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-05-07 15:09:04 Re: possible memory leak with SRFs
Previous Message Andy Lester 2010-05-07 14:48:29 Re: PATCH: Minor notes in CLUSTER page