diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-11-28 16:52:54 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-11-29 21:48:11 -0300 |
commit | f5f92bdc44ffdf577244e0d055825cacd0cdea10 (patch) | |
tree | e2314619870700916729b33348a33d94f394b22c /src/backend/access/transam/multixact.c | |
parent | d9484ab5f3cbcfea64536fec333723f9aa4c0b2c (diff) | |
download | postgresql-f5f92bdc44ffdf577244e0d055825cacd0cdea10.tar.gz postgresql-f5f92bdc44ffdf577244e0d055825cacd0cdea10.zip |
Fix full-table-vacuum request mechanism for MultiXactIds
While autovacuum dutifully launched anti-multixact-wraparound vacuums
when the multixact "age" was reached, the vacuum code was not aware that
it needed to make them be full table vacuums. As the resulting
partial-table vacuums aren't capable of actually increasing relminmxid,
autovacuum continued to launch anti-wraparound vacuums that didn't have
the intended effect, until age of relfrozenxid caused the vacuum to
finally be a full table one via vacuum_freeze_table_age.
To fix, introduce logic for multixacts similar to that for plain
TransactionIds, using the same GUCs.
Backpatch to 9.3, where permanent MultiXactIds were introduced.
Andres Freund, some cleanup by Álvaro
Diffstat (limited to 'src/backend/access/transam/multixact.c')
-rw-r--r-- | src/backend/access/transam/multixact.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index de0193aaf64..90fa030caf2 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -2375,6 +2375,21 @@ MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2) } /* + * MultiXactIdPrecedesOrEquals -- is multi1 logically <= multi2? + * + * XXX do we need to do something special for InvalidMultiXactId? + * (Doesn't look like it.) + */ +bool +MultiXactIdPrecedesOrEquals(MultiXactId multi1, MultiXactId multi2) +{ + int32 diff = (int32) (multi1 - multi2); + + return (diff <= 0); +} + + +/* * Decide which of two offsets is earlier. */ static bool |