Re: File system snapshots for multiple file systems

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: tomas(at)tuxteam(dot)de
Cc: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: File system snapshots for multiple file systems
Date: 2008-04-08 07:52:03
Message-ID: 47FB2423.8000103@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

tomas(at)tuxteam(dot)de wrote:
> Checkpoinitng is definitely coolest. If your file system doesn't do
> that, rsync is a good poor man's replacement:
>
> first rsync (takes long)
> (or work from an older backup)
> pg_start_backup(...)
> rsync (should be much faster)
> rsync WAL
> pg_stop_backup()
>
> I regularly rsync moderately active 500GB filesystems on fairly feeble
> hardware in about 5-10 minutes (for daily backups).

That will *not* get you a consistent, safe backup. If a PostgreSQL
checkpoint happens while you're rsyncing the WAL, the data files won't
(necessarily) contain updates that were made between the rsync of the
data finished and the checkpoint.

To do that, you'd need to set up continuous archiving, and do a PITR
restore.

What I was complaining/suggesting is that we should make what you did to
actually work, because it's a lot simpler. And as Jonah pointed out,
we'd need to inhibit checkpoints between pg_start_backup() and
pg_stop_backup() to make it work.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-04-08 07:57:51 Re: Feature freeze status
Previous Message Magnus Hagander 2008-04-08 07:50:10 Re: [PATCHES] Integer datetime by default