Cleanup and code review for the patch that made bgwriter active during
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 26 Jun 2009 20:29:04 +0000 (20:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 26 Jun 2009 20:29:04 +0000 (20:29 +0000)
commit7e60527f5176ccaddcbc2088c10a9224c09a364f
treea3c2a98aa39165339a3d1fb5731e9dfbbd4c3e19
parent8a332c9a75afbdb54e349c405de39d310b53d4c8
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
src/backend/access/transam/multixact.c
src/backend/access/transam/xlog.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/postmaster.c
src/backend/storage/smgr/md.c
src/include/access/xlog.h