Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu0j1-0004D8-Os for pgsql-general@arkaria.postgresql.org; Thu, 08 Mar 2018 18:57:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eu0j0-0005Lg-8G for pgsql-general@arkaria.postgresql.org; Thu, 08 Mar 2018 18:57:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu0iz-0005LW-TR for pgsql-general@lists.postgresql.org; Thu, 08 Mar 2018 18:57:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eu0ix-00051P-GF for pgsql-general@postgresql.org; Thu, 08 Mar 2018 18:57:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w28Iv6wx021766; Thu, 8 Mar 2018 13:57:06 -0500 From: Tom Lane To: Justin Pryzby cc: pgsql-general@postgresql.org Subject: Re: circular wait not triggering deadlock ? In-reply-to: <20180308182629.GJ24441@telsasoft.com> References: <20180308182629.GJ24441@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Thu, 08 Mar 2018 12:26:29 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21764.1520535426.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 08 Mar 2018 13:57:06 -0500 Message-ID: <21765.1520535426@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Justin Pryzby writes: > Running pg10.2, I have a handful of maintenance jobs run in the middle o= f the > night, which appear to have gotten stuck waiting on each other.. > ts=3D# SELECT granted, pid, mode, virtualtransaction, virtualxid FROM pg= _locks WHERE virtualxid=3D'22/4317099' ORDER BY 1,2,3; > granted | pid | mode | virtualtransaction | virtualxid = > ---------+-------+---------------+--------------------+------------ > f | 20488 | ShareLock | 19/28401734 | 22/4317099 > t | 6471 | ExclusiveLock | 22/4317099 | 22/4317099 PID 20488 is evidently waiting for PID 6471 to finish its transaction. What's that one doing? > Is it a bug that this isn't caught by a deadlock detector and cancelled? We did find a bug recently with concurrent CREATE INDEX CONCURRENTLY's all waiting for each other to commit. regards, tom lane