Thread: pgsql: Cleanup and code review for the patch that made bgwriter active
pgsql: Cleanup and code review for the patch that made bgwriter active
From
tgl@postgresql.org (Tom Lane)
Date:
Log Message: ----------- 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 Modified Files: -------------- pgsql/src/backend/access/transam: multixact.c (r1.30 -> r1.31) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/multixact.c?r1=1.30&r2=1.31) xlog.c (r1.344 -> r1.345) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.344&r2=1.345) pgsql/src/backend/postmaster: bgwriter.c (r1.61 -> r1.62) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/bgwriter.c?r1=1.61&r2=1.62) postmaster.c (r1.582 -> r1.583) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c?r1=1.582&r2=1.583) pgsql/src/backend/storage/smgr: md.c (r1.147 -> r1.148) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/md.c?r1=1.147&r2=1.148) pgsql/src/include/access: xlog.h (r1.92 -> r1.93) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xlog.h?r1=1.92&r2=1.93)