Re: Enforcing that all WAL has been replayed after restoring from backup

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Enforcing that all WAL has been replayed after restoring from backup
Date: 2011-08-16 01:10:22
Message-ID: CAHGQGwGd0FTL39S4Be2P6M-okfrG=L_zkT4t-5KHkBdZ44T7Pw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 11, 2011 at 1:34 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Hmm, that's not possible for the 'tar' output, but would work for 'dir'
> output. Another similar idea would be to withhold the control file in memory
> until the end of backup, and append it to the output as last. The backup
> can't be restored until the control file is written out.
>
> That won't protect from more complicated scenarios, like if you take the
> backup without the -x flag, and copy some but not all of the required WAL
> files manually to the pg_xlog directory. But it'd be much better than
> nothing for 9.1.

We need to skip checking whether we've reached the end backup location
only when the server crashes while base backup using pg_start_backup. Right?
We can do this by *not* initializing ControlFile->backupStartPoint if the server
is doing crash recovery and backupEndRequired is false. What about the attached
patch?

Regards,

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

Attachment Content-Type Size
require-backup-end-record-2.patch text/x-patch 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-08-16 02:39:38 Re: Possible Bug in pg_upgrade
Previous Message Tom Lane 2011-08-16 01:01:04 VACUUM FULL versus relcache init files