Re: Hot Standby: Startup at shutdown checkpoint - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Hot Standby: Startup at shutdown checkpoint
Date
Msg-id 4BBDB0FB.7030607@enterprisedb.com
Whole thread Raw
In response to Re: Hot Standby: Startup at shutdown checkpoint  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Hot Standby: Startup at shutdown checkpoint  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> On Tue, 2010-04-06 at 10:22 +0100, Simon Riggs wrote:
> 
>> Initial patch. I will be testing over next day. No commit before at
>> least midday on Wed 7 Apr.
> 
> Various previous discussions sidelined a very important point: what
> exactly does it mean to "start recovery from a shutdown checkpoint"?

Hot standby should be possible as soon we know that the database is
consistent. That is, as soon as we've replayed WAL past the
minRecoveryPoint/backupStartPoint point indicated in pg_control.

> If standby_mode is enabled and there is no source of WAL, then we get a
> stream of messages saying
> 
> LOG:  record with zero length at 0/C000088
> ...
> 
> but most importantly we never get to the main recovery loop, so Hot
> Standby never gets to start at all. We can't keep retrying the request
> for WAL and at the same time enter the retry loop, executing lots of
> things that expect non-NULL pointers using a NULL xlog pointer.

You mean it can't find even the checkpoint record to start replaying? I
think the behavior in that scenario is fine as it is. The database isn't
consistent (or at least we can't know if it is, because we don't know
the redo pointer) until you read and replay the first checkpoint record.

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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Hot Standby: Startup at shutdown checkpoint
Next
From: Robert Haas
Date:
Subject: Re: A maze of twisty mailing lists all the same