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

Re: autovacuum truncate exclusive lock round two

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum truncate exclusive lock round two
Date: 2012-11-15 22:31:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> Use this lmgr feature inside count_nondeletable_pages() of vacuumlazy.c to
> periodically check, if there is a conflicting lock request waiting. If not,
> keep going. If there is a waiter, truncate the relation to the point checked
> thus far, release the AccessExclusiveLock, then loop back to where we
> acquire this lock in the first place and continue checking/truncating.

I think that maybe we could just bail out after releasing the
AccessExclusiveLock and trust autovacuum to get back to truncating that
relation later. That would allow removing 2 of the 3 GUCs below:

>     autovacuum_truncate_lock_check = 100ms # how frequent to check
>                                            # for conflicting locks

This is the one remaining. Could we maybe check for lock conflict after
every move backward a page, or some multiple thereof? The goal would be
to ensure that progress is made, while also being aware of concurrent
activity, ala CHECK_FOR_INTERRUPTS().

Dimitri Fontaine     PostgreSQL : Expertise, Formation et Support

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2012-11-15 22:38:47
Subject: Re: another idea for changing global configuration settings from SQL
Previous:From: Peter GeogheganDate: 2012-11-15 22:25:55
Subject: Re: Index only scans wiki page

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