aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Gustafsson <dgustafsson@postgresql.org>2023-04-25 13:54:10 +0200
committerDaniel Gustafsson <dgustafsson@postgresql.org>2023-04-25 13:54:10 +0200
commitcba3c8f6dd7fffb63eac2f31d98bd23816959d04 (patch)
treeeba17b533e0ab392e1961a8e9268dc2a1c07da68 /src
parentee71cad9a7c05e705531938f3a92b8bd8ad97ce2 (diff)
downloadpostgresql-cba3c8f6dd7fffb63eac2f31d98bd23816959d04.tar.gz
postgresql-cba3c8f6dd7fffb63eac2f31d98bd23816959d04.zip
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 <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)
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/autovacuum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index bd77b6f85bc..5e64dcf4d69 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -2913,7 +2913,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);