Cleanup and code review for the patch that made bgwriter active during

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 2de48a83e65911ec8fc71fc87d75a75f5a3d6090
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2009-06-26T20:29:04Z
Releases: 8.4.0
Cleanup and code review for the patch that made bgwriter active during
archive recovery.  Invent a separate state variable and inquiry function
for XLogInsertAllowed() to clarify some tests and make the management of
writing the end-of-recovery checkpoint less klugy.  Fix several places
that were incorrectly testing InRecovery when they should be looking at
RecoveryInProgress or XLogInsertAllowed (because they will now be executed
in the bgwriter not startup process).  Clarify handling of bad LSNs passed
to XLogFlush during recovery.  Use a spinlock for setting/testing
SharedRecoveryInProgress.  Improve quite a lot of comments.

Heikki and Tom

Files