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

Commit9dc842f

Browse files
committed
Don't try to truncate multixact SLRU files in checkpoints done during xlog
recovery. In the first place, it doesn't work because slru'slatest_page_number isn't set up yet (this is why we've been hearing reportsof strange "apparent wraparound" log messages during crash recovery, butonly from people who'd managed to advance their next-mxact counters someconsiderable distance from 0). In the second place, it seems a bit unwiseto be throwing away data during crash recovery anwyway. This latterconsideration convinces me to just disable truncation during recovery,rather than computing latest_page_number and pushing ahead.
1 parenta8e44f0 commit9dc842f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
4343
* Portions Copyright (c) 1994, Regents of the University of California
4444
*
45-
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.19 2006/07/13 16:49:13 momjian Exp $
45+
* $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.20 2006/07/20 00:46:42 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -1493,9 +1493,14 @@ CheckPointMultiXact(void)
14931493

14941494
/*
14951495
* Truncate the SLRU files. This could be done at any time, but
1496-
* checkpoint seems a reasonable place for it.
1496+
* checkpoint seems a reasonable place for it. There is one exception:
1497+
* if we are called during xlog recovery, then shared->latest_page_number
1498+
* isn't valid (because StartupMultiXact hasn't been called yet) and
1499+
* so SimpleLruTruncate would get confused. It seems best not to risk
1500+
* removing any data during recovery anyway, so don't truncate.
14971501
*/
1498-
TruncateMultiXact();
1502+
if (!InRecovery)
1503+
TruncateMultiXact();
14991504
}
15001505

15011506
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp