Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ea70595

Browse files
committed
Increase threshold for multixact member emergency autovac to 50%.
Analysis by Noah Misch shows that the 25% threshold set by commit 53bb309 is lower than any other, similar autovac threshold. While we don't know exactly what value will be optimal for all users, it is better to err a little on the high side than on the low side. A higher value increases the risk that users might exhaust the available space and start seeing errors before autovacuum can clean things up sufficiently, but a user who hits that problem can compensate for it by reducing autovacuum_multixact_freeze_max_age to a value dependent on their average multixact size. On the flip side, if the emergency cap imposed by that patch kicks in too early, the user will experience excessive wraparound scanning and will be unable to mitigate that problem by configuration. The new value will hopefully reduce the risk of such bad experiences while still providing enough headroom to avoid multixact member exhaustion for most users. Along the way, adjust the documentation to reflect the effects of commit 04e6d3b, which taught autovacuum to run for multixact wraparound even when autovacuum is configured off.
1 parent 8ec1a3a commit ea70595

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/src/sgml/maintenance.sgml

+4-3
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,12 @@ HINT: Stop the postmaster and vacuum that database in single-user mode.
653653
<para>
654654
As a safety device, a whole-table vacuum scan will occur for any table
655655
whose multixact-age is greater than
656-
<xref linkend="guc-autovacuum-multixact-freeze-max-age">.
657-
This will occur even if autovacuum is nominally disabled. Whole-table
656+
<xref linkend="guc-autovacuum-multixact-freeze-max-age">. Whole-table
658657
vacuum scans will also occur progressively for all tables, starting with
659658
those that have the oldest multixact-age, if the amount of used member
660-
storage space exceeds the amount 25% of the addressible storage space.
659+
storage space exceeds the amount 50% of the addressible storage space.
660+
Both of these kinds of whole-table scans will occur even if autovacuum is
661+
nominally disabled.
661662
</para>
662663
</sect3>
663664
</sect2>

src/backend/access/transam/multixact.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
((xid) % MULTIXACT_MEMBERS_PER_MEMBERGROUP) * sizeof(TransactionId))
168168

169169
/* Multixact members wraparound thresholds. */
170-
#define MULTIXACT_MEMBER_SAFE_THRESHOLD (MaxMultiXactOffset / 4)
170+
#define MULTIXACT_MEMBER_SAFE_THRESHOLD (MaxMultiXactOffset / 2)
171171
#define MULTIXACT_MEMBER_DANGER_THRESHOLD \
172172
(MaxMultiXactOffset - MaxMultiXactOffset / 4)
173173

0 commit comments

Comments
 (0)