Re: Signaling of waiting for a cleanup lock? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Signaling of waiting for a cleanup lock?
Date
Msg-id 20140414170142.GG5822@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: Signaling of waiting for a cleanup lock?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> In an ideal world, when we needed to wait for a cleanup lock, we'd cause
> the lock manager to set up pre-granted sharable page locks for all the
> processes currently holding buffer pins, and then wait for an exclusive
> page lock.  The current hack of signaling when you're the last one off the
> page would be replaced by releasing your lock (if it exists) when you drop
> your own pin.  I'm not sure it's really worth the trouble to try to do
> this, but it would solve the visibility problem; and it might allow us to
> be a bit smarter about the priority of a cleanup lock request versus
> incoming regular pin requests.

AFAIU this would represent a behavioral change: right now, vacuum waits
until everybody is gone, and new pinners might arrive while vacuum is
waiting.  With this scheme, new pinners would have to wait behind
vacuum.  Maybe this change alone is enough to avoid vacuum blocking for
long periods waiting for cleanup lock.

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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Including replication slot data in base backups
Next
From: Tom Lane
Date:
Subject: Re: Signaling of waiting for a cleanup lock?