Re: Backup history file should be replicated in Streaming Replication?

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Backup history file should be replicated in Streaming Replication?
Date: 2009-12-24 04:39:32
Message-ID: 3f0b79eb0912232039o5f256eeeqdc7da75d4ecc0de@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 23, 2009 at 7:50 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Ok. How about writing the history file in pg_stop_backup() for
> informational purposes only. Ie. never read it, but rely on the WAL
> records instead.

Sounds good. I'll make such change as a self-contained patch.

> I just realized that the current history file fails to recognize this
> scenario:
>
> 1. pg_start_backup()
> 2. cp -a $PGDATA data-backup
> 3. create data-backup/recovery.conf
> 4. postmaster -D data-backup
>
> That is, starting postmaster on a data directory, without ever calling
> pg_stop_backup(). Because pg_stop_backup() was not called, the history
> file is not there, and recovery won't complain about not reaching the
> safe starting point.
>
> That is of course a case of "don't do that!", but perhaps we should
> refuse to start up if the backup history file is not found? At least in
> the WAL-based approach, I think we should refuse to start up if we don't
> see the pg_stop_backup WAL record.

Agreed.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-12-24 04:45:11 Re: Removing pg_migrator limitations
Previous Message Fujii Masao 2009-12-24 04:34:58 updateMinRecoveryPoint bug?