Re: Dangers of fsync = off

From: Joel Dice <dicej(at)mailsnare(dot)net>
To: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Dangers of fsync = off
Date: 2007-05-08 15:20:27
Message-ID: alpine.DEB.0.83.0705080906160.719@joeldicepc.ecovate.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for your response, Andrew.

On Tue, 8 May 2007, Andrew Sullivan wrote:

> On Fri, May 04, 2007 at 08:54:10AM -0600, Joel Dice wrote:
>>
>> My next question is this: what are the dangers of turning fsync off in the
>> context of a high-availablilty cluster using asynchronous replication?
>
> My real question is why you want to turn it off. If you're using a
> battery-backed cache on your disk controller, then fsync ought to be
> pretty close to free. Are you sure that turning it off will deliver
> the benefit you think it will?

You may very well be right. I tend to think in terms of software
solutions, but a hardware solution may be most appropriate here. In any
case, I'm not at all sure this will bring a significant peformance
improvement. I just want to understand the implications before I start
fiddling; if fsync=off is dangerous, it doesn't matter what the
performance benefits may be.

>> on Y. Thus, database corruption on X is irrelevant since our first step
>> is to drop them.
>
> Not if the corruption introduces problems for replication, which is
> indeed possible.

That's exactly what I want to understand. How, exactly, is this possible?
If the danger of fsync is that it may leave the on-disk state of the
database in an inconsistent state after a crash, it would not seem to have
any implications for activity occurring prior to the crash. In
particular, a trigger-based replication system would seem to be immune.

In other words, while there may be ways the master could cause corruption
on the slave, I don't see how they could be related to the fsync setting.

- Joel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2007-05-08 15:25:58 Re: PITR and tar
Previous Message Jim Nasby 2007-05-08 15:15:48 Re: Any "guide to indexes" exists?