Re: effective_multixact_freeze_max_age issue
Anton A. Melnikov <a.melnikov@postgrespro.ru>
From: "Anton A. Melnikov" <a.melnikov@postgrespro.ru>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Nathan Bossart <nathandbossart@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Thomas Munro <thomas.munro@gmail.com>, Robert Haas <robertmhaas@gmail.com>,
"Bossart, Nathan" <bossartn@amazon.com>,
Jeremy Schneider <schneider@ardentperf.com>
Date: 2024-04-05T06:30:02Z
Lists: pgsql-hackers
Attachments
- fix-agressive-vacuum-conds.patch (text/x-patch) patch
Hi, Peter! Sorry! For a some time i forgot about this thread and forgot to thank you for your answer. Thereby now its clear for me that this patch allows the autovacuum to win some time between OldestXmin and nextXID that could not be used before. I think, it maybe especially useful for high-load applications. Digging depeer, i found some inconsistency between current docs and the real behavior and would like to bring this to your attention. Now the doc says that an aggressive vacuum scan will occur for any table whose multixact-age is greater than autovacuum_multixact_freeze_max_age. But really vacuum_get_cutoffs() will return true when multixact-age is greater or equal than autovacuum_multixact_freeze_max_age if relminmxid is not equal to one. If relminmxid is equal to one then vacuum_get_cutoffs() return true even multixact-age is less by one then autovacuum_multixact_freeze_max_age. For instance, if relminmxid = 1 and multixact_freeze_table_age = 100, vacuum will start to be aggressive from the age of 99 (when ReadNextMultiXactId() = 100). The patch attached attempts to fix this and tries to use semantic like in the doc. The similar fix was made for common xacts too. Additional check for relminxid allows to disable agressive scan at all if it is invalid. But i'm not sure if such a check is needed here. Please take it into account. With kindly regards, -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Commits
-
Derive freeze cutoff from nextXID, not OldestXmin.
- c3ffa731a5f9 16.0 landed
-
Consolidate VACUUM xid cutoff logic.
- efa4a9462a07 15.0 cited
-
Fix bug that could try to freeze running multixacts.
- 6bda2af039d4 13.0 cited
-
Teach autovacuum about multixact member wraparound.
- 53bb309d2d5a 9.5.0 cited