Обсуждение: pgsql: Avoid having autovacuum workers wait for relation locks.

Поиск
Список
Период
Сортировка

pgsql: Avoid having autovacuum workers wait for relation locks.

От
Robert Haas
Дата:
Avoid having autovacuum workers wait for relation locks.

Waiting for relation locks can lead to starvation - it pins down an
autovacuum worker for as long as the lock is held.  But if we're doing
an anti-wraparound vacuum, then we still wait; maintenance can no longer
be put off.

To assist with troubleshooting, if log_autovacuum_min_duration >= 0,
we log whenever an autovacuum or autoanalyze is skipped for this reason.

Per a gripe by Josh Berkus, and ensuing discussion.

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/config.sgml            |    5 +++-
src/backend/commands/analyze.c      |   15 ++++++++++++-
src/backend/commands/vacuum.c       |   39 ++++++++++++++++++++++++++--------
src/backend/postmaster/autovacuum.c |   14 +++++++++--
src/include/nodes/parsenodes.h      |    3 +-
5 files changed, 61 insertions(+), 15 deletions(-)