lazy vacuum sleeps with exclusive lock on table - Mailing list pgsql-hackers

From Alvaro Herrera
Subject lazy vacuum sleeps with exclusive lock on table
Date
Msg-id 20070628211654.GD22200@alvh.no-ip.org
Whole thread Raw
Responses Re: lazy vacuum sleeps with exclusive lock on table
List pgsql-hackers
Hi,

I noticed that lazy vacuum acquires an exclusive lock at the end, to be
able to truncate the table.  This is not a surprise.  If it cannot
acquire the lock, it simply skips truncating the table and goes on with
life.

However, what's problematic is that if a non-zero cost delay has been
set, it will happily take naps while determining what to truncate :-(
This seems a bad idea.  It also may explain why some people is seeing
autovacuum blocking other processes.  It also readily explains why this
is so when there are no non-granted locks for autovacuum.

Comments?  I think we should remove the sleep in the truncate phase.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: imad
Date:
Subject: Re: write past chunk end in ExprContext / to_char
Next
From: "Simon Riggs"
Date:
Subject: Re: SetBufferCommitInfoNeedsSave and race conditions