Re: Dangers of fsync = off - Mailing list pgsql-general

From Joel Dice
Subject Re: Dangers of fsync = off
Date
Msg-id alpine.DEB.0.83.0705080906160.719@joeldicepc.ecovate.com
Whole thread Raw
In response to Re: Dangers of fsync = off  (Andrew Sullivan <ajs@crankycanuck.ca>)
Responses Re: Dangers of fsync = off
Re: Dangers of fsync = off
List 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

pgsql-general by date:

Previous
From: Simon Smith
Date:
Subject: Solaris Postgresql 8.1.8 vs Postgresql 8.2.4
Next
From: ebmb
Date:
Subject: User restrictions