Re: Consistent PITR backup

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Karcher <thkarcher(at)gmx(dot)de>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Consistent PITR backup
Date: 2007-10-11 14:22:49
Message-ID: 13019.1192112569@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thomas Karcher <thkarcher(at)gmx(dot)de> writes:
> My idea is now: When doing a consistent PITR backup, extend the
> documented steps between 4 (pg_stop_backup()) and 5 (wait for archived
> WAL file) with a busy wait on pg_xlog/archive_status/*.ready files - as
> soon as no .ready files are there anymore, the archiver has done its
> work, and I can safely backup the archived WAL files in order to have a
> really consistent backup.

If the database is busy, you might never see an instant where there are
no .ready files. Certainly it's possible that this approach will
archive many more segments than you need.

> Is that right? Or is there an easier way to do it?

I believe the intended way to do this is to look at pg_stop_backup's
return value to determine the last segment you need to archive.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2007-10-11 14:29:51 Re: Postgres database is not logging any messages after the reboot
Previous Message Malm Paul 2007-10-11 09:59:09 reading a blob from a postggreSQL db