]> granicus.if.org Git - postgresql/commit
Improve multixact emergency autovacuum logic.
authorAndres Freund <andres@anarazel.de>
Sun, 21 Jun 2015 16:57:28 +0000 (18:57 +0200)
committerAndres Freund <andres@anarazel.de>
Sun, 21 Jun 2015 17:00:30 +0000 (19:00 +0200)
commitec1408155d3567b9e9871ad092ea773251d515d9
tree4e8517e7e74e4f69c15feca0fbc1d5a247287053
parent67876a17eb36cea9d98a89defe1b5dd4d867bd64
Improve multixact emergency autovacuum logic.

Previously autovacuum was not necessarily triggered if space in the
members slru got tight. The first problem was that the signalling was
tied to values in the offsets slru, but members can advance much
faster. Thats especially a problem if old sessions had been around that
previously prevented the multixact horizon to increase. Secondly the
skipping logic doesn't work if the database was restarted after
autovacuum was triggered - that knowledge is not preserved across
restart. This is especially a problem because it's a common
panic-reaction to restart the database if it gets slow to
anti-wraparound vacuums.

Fix the first problem by separating the logic for members from
offsets. Trigger autovacuum whenever a multixact crosses a segment
boundary, as the current member offset increases in irregular values, so
we can't use a simple modulo logic as for offsets.  Add a stopgap for
the second problem, by signalling autovacuum whenver ERRORing out
because of boundaries.

Discussion: 20150608163707.GD20772@alap3.anarazel.de

Backpatch into 9.3, where it became more likely that multixacts wrap
around.
src/backend/access/transam/multixact.c