Re: Incrementally Updated Backups - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Incrementally Updated Backups
Date
Msg-id 20100912113200.GB2409@svana.org
Whole thread Raw
In response to Re: Incrementally Updated Backups  ("J. Roeleveld" <joost@antarean.org>)
Responses Re: Incrementally Updated Backups  ("J. Roeleveld" <joost@antarean.org>)
List pgsql-general
On Sun, Sep 12, 2010 at 12:18:10PM +0200, J. Roeleveld wrote:
> How can you ensure the snapshot is in a consistent state if the server is
> running?
>
> If a snapshot is taken between 2 updates in a single transaction, only half of
> this transaction is included in the snapshot.
> I would never take an LVM (or similar) snapshot of an application that can't
> be paused in a way to provide a consistent filesystem.

That's the trick, the filesystem is always in a consistant state,
otherwise how could a database survive a power failure?

The trick is WAL, which ensure that changes are logged consistantly and
replays them if the database crashes.

If you take a snapshot the database will simply startup and replay the
log as if the machine crashed at the point. All committed transactions
appears anything uncommitted vanishes.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first.
>                                       - Charles de Gaulle

Attachment

pgsql-general by date:

Previous
From: "J. Roeleveld"
Date:
Subject: Re: Incrementally Updated Backups
Next
From: sunpeng
Date:
Subject: why can't see the updated value after SPI_execute("update ....", false, 1);