From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Avoid useless respawining the autovacuum launcher at high speed. |
Date: | 2017-01-20 21:28:02 |
Message-ID: | E1cUgj4-0003Gd-FM@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Avoid useless respawining the autovacuum launcher at high speed.
When (1) autovacuum = off and (2) there's at least one database with
an XID age greater than autovacuum_freeze_max_age and (3) all tables
in that database that need vacuuming are already being processed by a
worker and (4) the autovacuum launcher is started, a kind of infinite
loop occurs. The launcher starts a worker and immediately exits. The
worker, finding no worker to do, immediately starts the launcher,
supposedly so that the next database can be processed. But because
datfrozenxid for that database hasn't been advanced yet, the new
worker gets put right back into the same database as the old one,
where it once again starts the launcher and exits. High-speed ping
pong ensues.
There are several possible ways to break the cycle; this seems like
the safest one.
Amit Khandekar (code) and Robert Haas (comments), reviewed by
Álvaro Herrera.
Discussion: http://postgr.es/m/CAJ3gD9eWejf72HKquKSzax0r+epS=nAbQKNnykkMA0E8c+rMDg@mail.gmail.com
Branch
------
REL9_5_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/aeaaf62aa57a6b8d35a092b4897a801e1881a9a0
Modified Files
--------------
src/backend/postmaster/autovacuum.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2017-01-21 01:30:35 | pgsql: Move some things from builtins.h to new header files |
Previous Message | Robert Haas | 2017-01-20 20:53:17 | pgsql: Fix comparison logic in partition_bounds_equal for non-finite bo |