Re: autovacuum truncate exclusive lock round two - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: autovacuum truncate exclusive lock round two
Date
Msg-id 20121025162415.GF6442@alvh.no-ip.org
Whole thread Raw
In response to Re: autovacuum truncate exclusive lock round two  (Jan Wieck <JanWieck@Yahoo.com>)
Responses Re: autovacuum truncate exclusive lock round two  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
Jan Wieck wrote:

> In the original code, the maximum delay that autovacuum can cause by
> holding the exclusive lock is one deadlock_timeout (default 1s). It
> would appear reasonable to me to use max(deadlock_timeout/10,10ms)
> as the interval to check for a conflicting lock request. For another
> transaction that needs to access the table this is 10 times faster
> than it is now and still guarantees that autovacuum will make some
> progress with the truncate.

So you would be calling GetCurrentTimestamp() continuously?  Since you
mentioned adding a vacuum delay point I wonder if it would make sense to
test for lockers each time it would consider going to sleep, instead.
(One hazard to keep in mind is the case where no vacuum delay is
configured.)

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH 4/8] add simple xlogdump tool
Next
From: "Kevin Grittner"
Date:
Subject: Re: ToDo: KNN Search should to support DISTINCT clasuse?