Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita95f7fb

Browse files
committed
Avoid wholesale autovacuuming when autovacuum is nominally off.
When autovacuum is nominally off, we will still launch autovac workersto vacuum tables that are at risk of XID wraparound. But after we'd donethat, an autovac worker would proceed to autovacuum every table in thetargeted database, if they meet the usual thresholds for autovacuuming.This is at best pretty unexpected; at worst it delays response to thewraparound threat. Fix it so that if autovacuum is nominally off, we*only* do forced vacuums and not any other work.Per gripe from Andrey Zhidenkov. This has been like this all along,so back-patch to all supported branches.
1 parentaeebacf commita95f7fb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/backend/postmaster/autovacuum.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,14 +2711,21 @@ relation_needs_vacanalyze(Oid relid,
27112711
*wraparound=force_vacuum;
27122712

27132713
/* User disabled it in pg_class.reloptions? (But ignore if at risk) */
2714-
if (!force_vacuum&& !av_enabled)
2714+
if (!av_enabled&& !force_vacuum)
27152715
{
27162716
*doanalyze= false;
27172717
*dovacuum= false;
27182718
return;
27192719
}
27202720

2721-
if (PointerIsValid(tabentry))
2721+
/*
2722+
* If we found the table in the stats hash, and autovacuum is currently
2723+
* enabled, make a threshold-based decision whether to vacuum and/or
2724+
* analyze. If autovacuum is currently disabled, we must be here for
2725+
* anti-wraparound vacuuming only, so don't vacuum (or analyze) anything
2726+
* that's not being forced.
2727+
*/
2728+
if (PointerIsValid(tabentry)&&AutoVacuumingActive())
27222729
{
27232730
reltuples=classForm->reltuples;
27242731
vactuples=tabentry->n_dead_tuples;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp