Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 33CB11337B34 for ; Tue, 22 Feb 2011 17:21:12 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 22625-03 for ; Tue, 22 Feb 2011 21:21:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.catalyst.net.nz (bertrand.catalyst.net.nz [202.78.240.40]) by mail.postgresql.org (Postfix) with ESMTP id 2D0841337B51 for ; Tue, 22 Feb 2011 17:21:04 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id CABDA32306; Wed, 23 Feb 2011 10:20:30 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mstDfegN7g3B; Wed, 23 Feb 2011 10:20:20 +1300 (NZDT) Received: from [IPv6:2404:130:0:1000:222:15ff:fe5c:2471] (unknown [IPv6:2404:130:0:1000:222:15ff:fe5c:2471]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 2AB6432320; Wed, 23 Feb 2011 10:20:20 +1300 (NZDT) Message-ID: <4D64288D.4080402@catalyst.net.nz> Date: Wed, 23 Feb 2011 10:20:13 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Robert Haas CC: Greg Stark , Heikki Linnakangas , pgsql-bugs@postgresql.org Subject: Re: Hung Vacuum in 8.3 References: <4D6330E9.6030809@catalyst.net.nz> <4D635C1C.7040304@enterprisedb.com> <4D636247.600@catalyst.net.nz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/200 X-Sequence-Number: 29472 On 23/02/11 03:27, Robert Haas wrote: > On Tue, Feb 22, 2011 at 6:26 AM, Greg Stark wrote: >> Actually it's not waiting for the LockBuffer LWLock. it's waiting >> until your query unpins the buffer it wants. Vacuum tries to get an >> exclusive lock on the buffer, if it gets it then it checks if anyone >> is using that buffer. If someone is then it unlocks the buffer and >> waits until nobody has it pinned. > How bad it would be if we made LockBufferForCleanup() not wait? If we > can't obtain the buffer cleanup lock immediately, we just skip that > page and continue on. That would prevent us from updating > relfrozenxid, I guess, but we already can't do that if there are any > bits set in the visibility map. It could also leave some bloat in > the table, but probably not much (he says hopefully). > Seems like a good suggestion, and may leave less bloat than having the vacuum hung for potentially quite some time. Mark