Re: Re: [COMMITTERS] pgsql: Make standby server continuously retry restoring the next WAL

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>, Aidan Van Dyk <aidan@highrise.ca>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-03-25T12:55:42Z
Lists: pgsql-hackers

Attachments

Fujii Masao wrote:
> On second thought, the following lines seem to be necessary just after
> calling XLogPageRead() since it reads new WAL file from another source.
> 
>> 	if (readSource == XLOG_FROM_STREAM || readSource == XLOG_FROM_ARCHIVE)
>> 		emode = PANIC;
>> 	else
>> 		emode = emode_arg;

Yep.

Here's an updated patch, with these changes since the last patch:

* Fix the bug of a spurious PANIC in archive recovery, if the WAL ends
in the middle of a WAL record that continues over a WAL segment boundary.

* If a corrupt WAL record is found in archive or streamed from master in
standby mode, throw WARNING instead of PANIC, and keep trying. In
archive recovery (ie. standby_mode=off) it's still a PANIC. We can make
it a WARNING too, which gives the pre-9.0 behavior of starting up the
server on corruption. I prefer PANIC but the discussion is still going on.

* Small code changes to handling of failedSources, inspired by your
comment. No change in functionality.

This is also available in my git repository at
git://git.postgresql.org/git/users/heikki/postgres.git, branch "xlogchanges"

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