Re: Online base backup from the hot-standby - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Online base backup from the hot-standby
Date
Msg-id 4DDF7F02.2050004@enterprisedb.com
Whole thread Raw
In response to Online base backup from the hot-standby  (Jun Ishiduka <ishizuka.jun@po.ntts.co.jp>)
Responses Re: Online base backup from the hot-standby  (Jun Ishiduka <ishizuka.jun@po.ntts.co.jp>)
List pgsql-hackers
On 27.05.2011 09:09, Jun Ishiduka wrote:
>   STEP1: Make startup process to acquire backup-end-position from
>          not only backup-end record but also backup-history-file .
>            * startup process allows to acquire backup-end-position
>              from backup-history-file .
>            * When pg_basebackup is executed , backup-history-file is
>              sent to the designated backup server .

I don't much like that approach. The standby would need to be able to
write the backup history file to the archive at the end of backup, and
we'd have to reintroduce the code to fetch it from archive and, when
streaming, from the master. At the moment, the archiver doesn't even run
in the standby.

I think we'll need to write the end-of-backup location somewhere in the
base backup instead. pg_stop_backup() already returns it, the client
just needs to store it somewhere with the base backup. So I'm thinking
that the procedure for taking a base backup from slave would look
something like this:

1. psql postgres -c "SELECT pg_start_backup('label')";
2. tar cvzf basebackup.tar.gz $PGDATA
3. psql postgres -c "SELECT pg_stop_backup()"; > backup_end_location
4. (keep backup_end_location alongside basebackup.tar.gz)

Or, we can just document that the control file must be backed up *last*,
so that the minimum recovery point in the control file serves the same
purposes as the end-of-backup location.

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


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: switch UNLOGGED to LOGGED
Next
From: Peter Geoghegan
Date:
Subject: Re: kill -KILL: What happens?