Skip site navigation (1) Skip section navigation (2)

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

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(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-30 13:26:19
Message-ID: 4B3B54FB.2010601@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Fujii Masao wrote:
> On Thu, Dec 24, 2009 at 1:39 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> 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.
> 
> Done. Please see the attached patch.
> 
> Design:
> 
> * pg_stop_backup writes the backup-end xlog record which contains
>   the backup starting point.
> 
> * In archive recovery, the startup process doesn't mark the database
>   as consistent until it has read the backup-end record.
> 
> * A backup history file is still created as in the past, but is never
>   used.

As the patch stands, reachedBackupEnd is never set to true if starting
from a restore point after the end-of-backup. We'll need to store the
information that we've reached end-of-backup somewhere on disk.

Here's is modified patch that adds a new backupStartPoint field to
pg_control for that + some other minor editorialization.

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

Attachment: backup_end_xlog_record-2.patch
Description: text/x-diff (12.0 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2009-12-30 13:31:36
Subject: Re: Backup history file should be replicated in Streaming Replication?
Previous:From: Andrew DunstanDate: 2009-12-30 12:59:25
Subject: Re: exec_execute_message crash

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group