Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2348C6506B4 for ; Fri, 11 Jul 2008 14:23:28 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 02559-08-2 for ; Fri, 11 Jul 2008 14:23:18 -0300 (ADT) X-Greylist: delayed 00:22:58.237487 by SQLgrey-1.7.6 Received: from silene.metacarta.com (silene.metacarta.com [208.80.142.18]) by postgresql.org (Postfix) with ESMTP id BD76E650669 for ; Fri, 11 Jul 2008 14:23:08 -0300 (ADT) Received: from localhost (silene.metacarta.com [208.80.142.18]) by silene.metacarta.com (Postfix) with ESMTP id B212614C809C for ; Fri, 11 Jul 2008 13:00:05 -0400 (EDT) Received: from silene.metacarta.com ([208.80.142.18]) by localhost (silene.metacarta.com [208.80.142.18]) (amavisd-new, port 10024) with ESMTP id 22868-09 for ; Fri, 11 Jul 2008 13:00:03 -0400 (EDT) X-Auth-Received: from [10.0.0.177] (dhcp-10-0-0-177.metacarta.com [10.0.0.177]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by silene.metacarta.com (Postfix) with ESMTP id A49FF14C8092 for ; Fri, 11 Jul 2008 13:00:03 -0400 (EDT) Message-ID: <4877918E.7030308@metacarta.com> Date: Fri, 11 Jul 2008 12:59:58 -0400 From: Karl Wright User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: REINDEX/SELECT deadlock? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at metacarta.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/103 X-Sequence-Number: 30703 Hi, I just noticed what looks like a deadlock situation on postgresql 8.2.4. After more than an hour of running REINDEX, two processes are each in a "waiting" state and yet have no time used. This is also the first time I've seen this condition after some 48 hours of continuous load testing. The two postgresql processes that seem to be stuck on one another are: 1 S postgres 31812 22455 0 80 0 - 274059 semtim 12:13 ? 00:00:00 postgres: metacarta metacarta 127.0.0.1(54297) SELECT waiting 1 S postgres 32577 22455 0 80 0 - 274063 semtim 12:16 ? 00:00:00 postgres: metacarta metacarta 127.0.0.1(60377) REINDEX waiting The rest of the postgresql processes change; here's a snapshot. (Note that process 14349 is active and continues to intermittently run queries generated by another thread, but should not be blocking anything.) Unfortunately, I cannot tell you exactly what the deadlocked SELECT query is, but it is likely to be against the same table that the REINDEX command has been issued for. 1 S postgres 2046 22455 0 80 0 - 274059 - 12:23 ? 00:00:00 postgres: metacarta metacarta 127.0.0.1(33940) idle 1 S postgres 2097 22455 0 80 0 - 274059 - 12:24 ? 00:00:00 postgres: metacarta metacarta 127.0.0.1(36947) idle 0 S root 2380 4263 0 80 0 - 411 stext 12:24 pts/1 00:00:00 grep postgres: 1 R postgres 14349 22455 26 80 0 - 274385 - 11:51 ? 00:08:47 postgres: metacarta metacarta 127.0.0.1(52448) PARSE 1 S postgres 22457 22455 0 80 0 - 273864 - Jul10 ? 00:01:55 postgres: writer process 1 S postgres 22458 22455 0 80 0 - 2380 434161 Jul10 ? 00:00:50 postgres: stats collector process Does anyone know what may be going on here? Has this been fixed on later versions of postgresql? Thanks, Karl