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

Commit9cd6685

Browse files
committed
In the checkpoint written at the end of archive recovery, the WAL page header
was incorrectly initialized with timeline ID 0. That rendered the WAL pageunrecoverable, making a subsequent archive recovery stop at that point.ThisTimeLineID needs to be initialized before calling AdvanceXLInsertBuffer().This fixes bug #5011 reported by James Bardin. Backpatch to 8.4, as the bugwas introduced by the changes to use of bgwriter for writing theend-of-archive-recovery checkpoint. Patch by Tom Lane.
1 parenta814170 commit9cd6685

File tree

1 file changed

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

1 file changed

+12
-15
lines changed

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

Lines changed: 12 additions & 15 deletions
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.348 2009/08/12 20:53:30 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.349 2009/08/27 07:15:41 heikki Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -6444,6 +6444,17 @@ CreateCheckPoint(int flags)
64446444
}
64456445
}
64466446

6447+
/*
6448+
* An end-of-recovery checkpoint is created before anyone is allowed to
6449+
* write WAL. To allow us to write the checkpoint record, temporarily
6450+
* enable XLogInsertAllowed. (This also ensures ThisTimeLineID is
6451+
* initialized, which we need here and in AdvanceXLInsertBuffer.)
6452+
*/
6453+
if (flags&CHECKPOINT_END_OF_RECOVERY)
6454+
LocalSetXLogInsertAllowed();
6455+
6456+
checkPoint.ThisTimeLineID=ThisTimeLineID;
6457+
64476458
/*
64486459
* Compute new REDO record ptr = location of next XLOG record.
64496460
*
@@ -6566,20 +6577,6 @@ CreateCheckPoint(int flags)
65666577

65676578
START_CRIT_SECTION();
65686579

6569-
/*
6570-
* An end-of-recovery checkpoint is created before anyone is allowed to
6571-
* write WAL. To allow us to write the checkpoint record, temporarily
6572-
* enable XLogInsertAllowed.
6573-
*/
6574-
if (flags&CHECKPOINT_END_OF_RECOVERY)
6575-
LocalSetXLogInsertAllowed();
6576-
6577-
/*
6578-
* This needs to be done after LocalSetXLogInsertAllowed(), else
6579-
* ThisTimeLineID might still be uninitialized.
6580-
*/
6581-
checkPoint.ThisTimeLineID=ThisTimeLineID;
6582-
65836580
/*
65846581
* Now insert the checkpoint record into XLOG.
65856582
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp