Skip to content

Commit 0e8e5e8

Browse files
Fix vacuum_cost_delay check for balance calculation.
Commit 1021bd6 excluded autovacuum workers from cost-limit balance calculations when per-relation options were set. The code checks for limit and cost_delay being greater than zero, but since cost_delay can be set to -1 the test needs to check for greater than or zero. Backpatch to all supported branches since 1021bd6 was backpatched all the way at the time. Author: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CAD21AoBS7o6Ljt_vfqPQPf67AhzKu3fR0iqk8B=vVYczMugKMQ@mail.gmail.com Backpatch-through: v11 (all supported branches)
1 parent 4cc56f8 commit 0e8e5e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/postmaster/autovacuum.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,7 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map,
29632963
*/
29642964
tab->at_dobalance =
29652965
!(avopts && (avopts->vacuum_cost_limit > 0 ||
2966-
avopts->vacuum_cost_delay > 0));
2966+
avopts->vacuum_cost_delay >= 0));
29672967

29682968
/*
29692969
* When we decide to do vacuum or analyze, the existing stats cannot

0 commit comments

Comments
 (0)