Re: Data replication through disk replication

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Thomas Lopatic <thomas(at)lopatic(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Data replication through disk replication
Date: 2007-05-18 13:12:41
Message-ID: 20070518131241.GB29115@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 18, 2007 at 02:48:03PM +0200, Thomas Lopatic wrote:
> What I keep wondering: Isn't there substantial risk involved?
> I mean, suppose the master fails in the middle of a write. Isn't there
> the possibility that this corrupts the database? How robust is
> PostgreSQL's on-disk file format and write caching strategy against
> failures like this?

It would seem slightly more risk, but as long as the filesystem honours
fsync and doesn't mess with the order of the disk writes, then the
standard WAL log should protect you fine. All you need to be sure of
is that the write to WAL gets written to disk before the actual data
files do.

> With something like Slony-I some data may not be fully copied to the
> slave when the master crashes. So there may be data loss. But there
> isn't the risk of database corruption.

The biggest benefit to Slony in my eyes is that it's asyncronous. If
the network connection dies, slony can handle that but I have no idea
what your DRDB might do...

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Florian Weimer 2007-05-18 13:24:01 Re: Memory settings, vm.overcommit, how to get it really safe?
Previous Message Kenneth Downs 2007-05-18 12:48:38 Re: Paypal and "going root"