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

Commitd9484ab

Browse files
committed
Replace hardcoded 200000000 with autovacuum_freeze_max_age
Parts of the code used autovacuum_freeze_max_age to determine whetheranti-multixact-wraparound vacuums are necessary, while others used ahardcoded 200000000 value. This leads to problems whenautovacuum_freeze_max_age is set to a non-default value. Use the lattereverywhere.Backpatch to 9.3, where vacuuming of multixacts was introduced.Andres Freund
1 parenta9380b5 commitd9484ab

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#include"funcapi.h"
7575
#include"miscadmin.h"
7676
#include"pg_trace.h"
77+
#include"postmaster/autovacuum.h"
7778
#include"storage/lmgr.h"
7879
#include"storage/pmsignal.h"
7980
#include"storage/procarray.h"
@@ -1958,6 +1959,10 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
19581959
/*
19591960
* We'll refuse to continue assigning MultiXactIds once we get within 100
19601961
* multi of data loss.
1962+
*
1963+
* Note: This differs from the magic number used in
1964+
* SetTransactionIdLimit() since vacuum itself will never generate new
1965+
* multis.
19611966
*/
19621967
multiStopLimit=multiWrapLimit-100;
19631968
if (multiStopLimit<FirstMultiXactId)
@@ -1979,9 +1984,12 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
19791984

19801985
/*
19811986
* We'll start trying to force autovacuums when oldest_datminmxid gets to
1982-
* be more than 200 million transactions old.
1987+
* be more than autovacuum_freeze_max_age mxids old.
1988+
*
1989+
* It's a bit ugly to just reuse limits for xids that way, but it doesn't
1990+
* seem worth adding separate GUCs for that purpose.
19831991
*/
1984-
multiVacLimit=oldest_datminmxid+200000000;
1992+
multiVacLimit=oldest_datminmxid+autovacuum_freeze_max_age;
19851993
if (multiVacLimit<FirstMultiXactId)
19861994
multiVacLimit+=FirstMultiXactId;
19871995

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp