How about a option to disable autovacuum cancellation on lock conflict? - Mailing list pgsql-hackers

From Andres Freund
Subject How about a option to disable autovacuum cancellation on lock conflict?
Date
Msg-id 20141129082252.GG5164@alap3.anarazel.de
Whole thread Raw
Responses Re: How about a option to disable autovacuum cancellation on lock conflict?  (Magnus Hagander <magnus@hagander.net>)
Re: How about a option to disable autovacuum cancellation on lock conflict?  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
Hi,

I've more than once seen that autovacuums on certain tables never
succeed because regular exclusive (or similar) lockers cause it to give
way/up before finishing.  Usually if some part of the application uses
explicit exclusive locks.

In general I think it's quite imortant that autovacuum bheaves that
way. But I think it might be worhtwile to offer an option to disable
that behaviour. If some piece of application logic requires exclusive
locks and that leads to complete starvation of autovacuum, there's
really nothing that can be done but to manually schedule vacuums right
now.

I can see two possible solutions:

1) Add a reloption that allows to configure whether autovacuum gives way  to locks acquired by user backends.
2) Add a second set of autovacuum_*_scale_factor variables that governs  a threshhold after which autovacuum doesn't
getcancelled anymore.
 

Opinions?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: New error code to track unsupported contexts
Next
From: David Rowley
Date:
Subject: Removing INNER JOINs