Re: synchronous replication + fsync=off? - Mailing list pgsql-general

From Jaime Casanova
Subject Re: synchronous replication + fsync=off?
Date
Msg-id CAJKUy5it4Pd+4DsQw+KzDWJFjadejGFR_JJJ65SAmeSjVWPsgw@mail.gmail.com
Whole thread Raw
In response to synchronous replication + fsync=off?  ("Schubert, Joerg" <jschubert@cebacus.de>)
Responses Re: synchronous replication + fsync=off?  (Scott Marlowe <scott.marlowe@gmail.com>)
Re: synchronous replication + fsync=off?  ("Tomas Vondra" <tv@fuzzy.cz>)
List pgsql-general
On Thu, Nov 17, 2011 at 7:52 AM, Schubert, Joerg <jschubert@cebacus.de> wrote:
> Hello,
>
> I have two servers with battery backed power supply (USV). So it is
> unlikely, that both will crash at the same time.
>
> Will synchronous replication work with fsync=off?
> That means we will commit to system cache, but not to disk. Data will not
> survive a system crash but the second system should still be consistent.
>

you should never use fsync=off (in production at least)

the appropiate parameter to use is synchronous_commit which is the one
that controls synchronous replication:
off = no local nor remote synchronous commit
local = local synchronous commit but no remote
on = both, local and remote, synchronous commit

synchronous commit = flushed to disk

once all that said, i guess you can use fsync on any combination (off
on master and on on standby, for your case) but i haven't tried.
anyway that will guarantee you will lose your master instalation on OS
crash and i think to remember that even if the OS doesn't crash there
is a risk (altough i can't find the mail saying that)

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Is it ever necessary to vacuum a table that only gets inserts/updates?
Next
From: Scott Marlowe
Date:
Subject: Re: synchronous replication + fsync=off?