mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
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
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.30 2009/01/20 18:59:37 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.31 2009/06/26 20:29:04 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1543,7 +1543,7 @@ CheckPointMultiXact(void)
|
||||
* SimpleLruTruncate would get confused. It seems best not to risk
|
||||
* removing any data during recovery anyway, so don't truncate.
|
||||
*/
|
||||
if (!InRecovery)
|
||||
if (!RecoveryInProgress())
|
||||
TruncateMultiXact();
|
||||
|
||||
TRACE_POSTGRESQL_MULTIXACT_CHECKPOINT_DONE(true);
|
||||
|
||||
Reference in New Issue
Block a user