Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 69FB81337BDB for ; Mon, 7 Mar 2011 20:04:16 -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 66645-08 for ; Tue, 8 Mar 2011 00:04:08 +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 28BE9133798E for ; Mon, 7 Mar 2011 20:04:08 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 076D232369; Tue, 8 Mar 2011 13:04:06 +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 lAr1gdKpoSkn; Tue, 8 Mar 2011 13:04:03 +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 A81CD325CF; Tue, 8 Mar 2011 13:03:07 +1300 (NZDT) Message-ID: <4D75723A.5060207@catalyst.net.nz> Date: Tue, 08 Mar 2011 13:03:06 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: Greg Stark CC: 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> <4D64282F.2030400@catalyst.net.nz> <4D757078.7040301@catalyst.net.nz> In-Reply-To: <4D757078.7040301@catalyst.net.nz> 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: 201103/135 X-Sequence-Number: 29645 On 08/03/11 12:55, Mark Kirkwood wrote: > On 23/02/11 10:18, Mark Kirkwood wrote: >> On 23/02/11 00:26, Greg Stark wrote: >>> >>> It's also possible there's a bug of course. If someone was using that >>> buffer and somehow failed to notify the vacuum that they were done it >>> would wait for a very long time (forever?). However if vacuum >>> eventually continued when the query was canceled then it seems likely >>> it was working as intended. >>> >> >> Greg, thanks for clarifying this. >> >> Unfortunately this time around I canceled the vacuum and then the >> query. However *next* time I'll get rid of the query 1st and see what >> happens. >> > > I have another one here: > > postgres=# select datname,procpid, query_start, current_query > from pg_stat_activity > where now() - query_start > '2 hours'::interval > order by query_start; > datname | procpid | query_start | current_query > ---------+---------+-------------------------------+----------------- > stuff | 23957 | 2011-03-08 06:02:02.659159+13 | VACUUM ANALYZE; > > postgres=# select datname,procpid, query_start, current_query > from pg_stat_activity > where now() - backend_start > '2 hours'::interval > order by query_start; > datname | procpid | query_start | current_query > ---------+---------+-------------------------------+----------------- > stuff | 23957 | 2011-03-08 06:02:02.659159+13 | VACUUM ANALYZE; > : > stuff | 30018 | 2011-03-08 11:57:03.214177+13 | > stuff | 11390 | 2011-03-08 12:27:20.390122+13 | > stuff | 10178 | 2011-03-08 12:28:59.328265+13 | > stuff | 5100 | 2011-03-08 12:30:10.318204+13 | > stuff | 10255 | 2011-03-08 12:32:21.520814+13 | > stuff | 29993 | 2011-03-08 12:32:26.562835+13 | > stuff | 10204 | 2011-03-08 12:40:57.059958+13 | > stuff | 10206 | 2011-03-08 12:41:11.708924+13 | > (9 rows) > > > It looks to me like whatever query buffer pins the vacuum *was* > waiting on should be well and truly over by now. The strace for the > vacuum looks the same as before: > > $ strace -p 23957 > Process 23957 attached - interrupt to quit > semop(39747613, 0x7fff53d3dec0, 1 > > > It certainly looks like the vacuum is not able to resume after setting > itself to sleep for some reason. > > > Immediately after I sent this, I saw the vacuum unlock itself and continue... so there *are* some queries still blocking it. I'm seeing some highish (1 -2 minute) lock waits for a certain table: postgres=# select datname,procpid, query_start, current_query from pg_stat_activity where now() - query_start > '1 minute' and procpid in (select distinct pid from pg_locks where not granted) order by query_start; datname | procpid | query_start | current_query ---------+---------+-------------------------------+------------------------------ stuff | 390 | 2011-03-08 12:57:01.752234+13 | UPDATE content.twitter_queue : SET error = $1 : WHERE twitter_queue_id = $2 (30 or so) which are probably not helping. So false alarm, no bug here it would seem, sorry. Mark