From: Daniel Gustafsson Date: Tue, 25 Apr 2023 11:54:10 +0000 (+0200) Subject: Fix vacuum_cost_delay check for balance calculation. X-Git-Tag: REL_16_BETA1~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfac8f8bc4a44c67c9f35b5266676278e4ba1217;p=thirdparty%2Fpostgresql.git Fix vacuum_cost_delay check for balance calculation. Commit 1021bd6a89 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 1021bd6a89 was backpatched all the way at the time. Author: Masahiko Sawada Reviewed-by: Melanie Plageman Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/CAD21AoBS7o6Ljt_vfqPQPf67AhzKu3fR0iqk8B=vVYczMugKMQ@mail.gmail.com Backpatch-through: v11 (all supported branches) --- diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index e23ec32e22f..f929b62e8ad 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -2947,7 +2947,7 @@ table_recheck_autovac(Oid relid, HTAB *table_toast_map, */ tab->at_dobalance = !(avopts && (avopts->vacuum_cost_limit > 0 || - avopts->vacuum_cost_delay > 0)); + avopts->vacuum_cost_delay >= 0)); } heap_freetuple(classTup);