Hot standby, recovery infrastructure - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Hot standby, recovery infrastructure
Date
Msg-id 497F1348.40001@enterprisedb.com
Whole thread Raw
Responses Re: Hot standby, recovery infrastructure  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Regarding this comment:

> +   /*
> +    * Prior to 8.4 we wrote a Shutdown Checkpoint at the end of recovery.
> +    * This could add minutes to the startup time, so we want bgwriter
> +    * to perform it. This then frees the Startup process to complete so we can
> +    * allow transactions and WAL inserts. We still write a checkpoint, but
> +    * it will be an online checkpoint. Online checkpoints have a redo
> +    * location that can be prior to the actual checkpoint record. So we want
> +    * to derive that redo location *before* we let anybody else write WAL,
> +    * otherwise we might miss some WAL records if we crash.
> +    */

Does this describe a failure case or something that would cause 
corruption? The tone of the message implies so, but I don't see anything 
wrong with deriving the redo location for the first checkpoint the usual 
way.

I belive the case of "missing some WAL records" refers to the 
possibility that someone connects to the database and does a WAL logged 
change before the first checkpoint starts. But if we then crash before 
the checkpoint finishes, we'll start crash recovery from the previous 
restartpoint/checkpoint as usual, and replay that WAL record as well. 
And if the first checkpoint finishes, the redo ptr of that checkpoint is 
after that WAL record, and those changes are safely on disk.

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


pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: Commitfest infrastructure (was Re: 8.4 release planning)
Next
From: Peter Eisentraut
Date:
Subject: Re: 8.4 release planning (was Re: [COMMITTERS] pgsql: Automatic view update rules)