Skip site navigation (1) Skip section navigation (2)

pgsql: Fix leakage of cost_limit when multiple autovacuum workers area

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix leakage of cost_limit when multiple autovacuum workers area
Date: 2010-11-20 03:30:01
Message-ID: E1PJe9J-0001uN-5b@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix leakage of cost_limit when multiple autovacuum workers are active.

When using default autovacuum_vac_cost_limit, autovac_balance_cost relied
on VacuumCostLimit to contain the correct global value ... but after the
first time through in a particular worker process, it didn't, because we'd
trashed it in previous iterations.  Depending on the state of other autovac
workers, this could result in a steady reduction of the effective
cost_limit setting as a particular worker processed more and more tables,
causing it to go slower and slower.  Spotted by Simon Poole (bug #5759).
Fix by saving and restoring the GUC variables in the loop in do_autovacuum.

In passing, improve a few comments.

Back-patch to 8.3 ... the cost rebalancing code has been buggy since it was
put in.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=b5efc094042638154d74fdb1e8344ae0ba977617

Modified Files
--------------
src/backend/postmaster/autovacuum.c |   63 +++++++++++++++++++++++++----------
1 files changed, 45 insertions(+), 18 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2010-11-20 03:48:58
Subject: Re: pgsql: Speed up conversion of signed integers to C strings.
Previous:From: Tom LaneDate: 2010-11-20 03:30:00
Subject: pgsql: Fix leakage of cost_limit when multiple autovacuum workers area

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group