Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87740ca

Browse files
committed
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 entriesduring recovery".
1 parentd2e7afe commit87740ca

File tree

1 file changed

+12
-1
lines changed
  • src/backend/access/transam

1 file changed

+12
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.345 2009/06/26 20:29:04 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.346 2009/08/07 19:29:49 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -463,6 +463,7 @@ static void readRecoveryCommandFile(void);
463463
staticvoidexitArchiveRecovery(TimeLineIDendTLI,
464464
uint32endLogId,uint32endLogSeg);
465465
staticboolrecoveryStopsHere(XLogRecord*record,bool*includeThis);
466+
staticvoidLocalSetXLogInsertAllowed(void);
466467
staticvoidCheckPointGuts(XLogRecPtrcheckPointRedo,intflags);
467468

468469
staticboolXLogCheckBuffer(XLogRecData*rdata,booldoPageWrites,
@@ -5758,6 +5759,13 @@ StartupXLOG(void)
57585759
{
57595760
intrmid;
57605761

5762+
/*
5763+
* Resource managers might need to write WAL records, eg, to record
5764+
* index cleanup actions. So temporarily enable XLogInsertAllowed in
5765+
* this process only.
5766+
*/
5767+
LocalSetXLogInsertAllowed();
5768+
57615769
/*
57625770
* Allow resource managers to do any required cleanup.
57635771
*/
@@ -5767,6 +5775,9 @@ StartupXLOG(void)
57675775
RmgrTable[rmid].rm_cleanup();
57685776
}
57695777

5778+
/* Disallow XLogInsert again */
5779+
LocalXLogInsertAllowed=-1;
5780+
57705781
/*
57715782
* Check to see if the XLOG sequence contained any unresolved
57725783
* references to uninitialized pages.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp