mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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
This commit is contained in:
@ -2374,6 +2374,21 @@ MultiXactIdPrecedes(MultiXactId multi1, MultiXactId multi2)
|
||||
return (diff < 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user