diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-07 19:29:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-07 19:29:57 +0000 |
commit | 88a675531f0742074e04aff5069a414aba8a075c (patch) | |
tree | 4f06294ca752bff15d8431bd7b5e68eb02032296 /src | |
parent | 3bd4dce7f6a0a6fc001934605a1bd0f659ae9a84 (diff) | |
download | postgresql-88a675531f0742074e04aff5069a414aba8a075c.tar.gz postgresql-88a675531f0742074e04aff5069a414aba8a075c.zip |
rm_cleanup functions need to be allowed to write WAL entries. This oversight
appears to explain the recent reports of "PANIC: cannot make new WAL entries
during recovery".
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/transam/xlog.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 5990bae8b84..b9dbe8f1316 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,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/xlog.c,v 1.345 2009/06/26 20:29:04 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.345.2.1 2009/08/07 19:29:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -463,6 +463,7 @@ static void readRecoveryCommandFile(void); static void exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg); static bool recoveryStopsHere(XLogRecord *record, bool *includeThis); +static void LocalSetXLogInsertAllowed(void); static void CheckPointGuts(XLogRecPtr checkPointRedo, int flags); static bool XLogCheckBuffer(XLogRecData *rdata, bool doPageWrites, @@ -5759,6 +5760,13 @@ StartupXLOG(void) int rmid; /* + * Resource managers might need to write WAL records, eg, to record + * index cleanup actions. So temporarily enable XLogInsertAllowed in + * this process only. + */ + LocalSetXLogInsertAllowed(); + + /* * Allow resource managers to do any required cleanup. */ for (rmid = 0; rmid <= RM_MAX_ID; rmid++) @@ -5767,6 +5775,9 @@ StartupXLOG(void) RmgrTable[rmid].rm_cleanup(); } + /* Disallow XLogInsert again */ + LocalXLogInsertAllowed = -1; + /* * Check to see if the XLOG sequence contained any unresolved * references to uninitialized pages. |