Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLKir-0004cj-G6 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Apr 2019 04:50:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLKip-0001gi-Pk for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Apr 2019 04:50:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLKip-0001Yl-C1 for pgsql-hackers@lists.postgresql.org; Tue, 30 Apr 2019 04:50:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLKin-0005Px-3H for pgsql-hackers@lists.postgresql.org; Tue, 30 Apr 2019 04:50:26 +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 x3U4oKw7026529; Tue, 30 Apr 2019 00:50:20 -0400 From: Tom Lane To: Andres Freund cc: Michael Paquier , Postgres hackers Subject: Re: REINDEX INDEX results in a crash for an index of pg_class since 9.6 In-reply-to: References: <20190425181648.lgffj43btacmxszu@alap3.anarazel.de> <26665.1556218209@sss.pgh.pa.us> <20190425195130.hhdp5tcpapnupszq@alap3.anarazel.de> <29295.1556222523@sss.pgh.pa.us> <20190425210309.cnofpjnwsrhdnahd@alap3.anarazel.de> <31933.1556226753@sss.pgh.pa.us> <20190426020248.iyev66bkpf2abxqd@alap3.anarazel.de> <7882.1556290296@sss.pgh.pa.us> <12189.1556575627@sss.pgh.pa.us> <20190429220924.lfptluzkujb26y2n@alap3.anarazel.de> <20190430030342.jmbgnih4q3cdoufz@alap3.anarazel.de> <26051.1556599053@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Mon, 29 Apr 2019 21:44:26 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26527.1556599820.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 30 Apr 2019 00:50:20 -0400 Message-ID: <26528.1556599820@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On April 29, 2019 9:37:33 PM PDT, Tom Lane wrote: >> Seems like putting reindexes of pg_class into a test script that runs >> in parallel with other DDL wasn't a hot idea. > Saw that. Will try to reproduce (and if necessary either run separately = or revert). But isn't that somewhat broken? They're not run in a transacti= on, so the locking shouldn't be deadlock prone. Hm? REINDEX INDEX is deadlock-prone by definition, because it starts by opening/locking the index and then it has to open/lock the index's table. Every other operation locks tables before their indexes. regards, tom lane