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 1hMDq4-00015c-Od for pgsql-hackers@arkaria.postgresql.org; Thu, 02 May 2019 15:41:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMDq3-0001lG-JG for pgsql-hackers@arkaria.postgresql.org; Thu, 02 May 2019 15:41:35 +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 1hMDq3-0001kB-6h for pgsql-hackers@lists.postgresql.org; Thu, 02 May 2019 15:41:35 +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 1hMDq0-0007YD-LO for pgsql-hackers@lists.postgresql.org; Thu, 02 May 2019 15:41:33 +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 x42FfSdV004871; Thu, 2 May 2019 11:41:28 -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: <20190502153107.o5zadep4ehebzoqy@alap3.anarazel.de> References: <20190501013638.7u7fwr4zktbyyng5@alap3.anarazel.de> <25049.1556727622@sss.pgh.pa.us> <20190501170603.hx6r3ztyvi3rlgq6@alap3.anarazel.de> <20190501172115.4cvz3rp6np43odut@alap3.anarazel.de> <5483.1556737736@sss.pgh.pa.us> <16043.1556754084@sss.pgh.pa.us> <20190502012520.eyfhhn5ix2ooflys@alap3.anarazel.de> <27459.1556762513@sss.pgh.pa.us> <20190502021913.axyvyyyw5547swy5@alap3.anarazel.de> <25661.1556808540@sss.pgh.pa.us> <20190502153107.o5zadep4ehebzoqy@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 02 May 2019 08:31:07 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4869.1556811688.1@sss.pgh.pa.us> Date: Thu, 02 May 2019 11:41:28 -0400 Message-ID: <4870.1556811688@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > ISTM that if we go down this path, we should split (not now, but either > still in v12, or *early* in v13), the sets of indexes that are intended > to a) not being used for catalog queries b) may be skipped for index > insertions. It seems pretty likely that somebody will otherwise soon > introduce an heap_update() somewhere into the index build process, and > it'll work just fine in testing due to HOT. Given the assertions you added in CatalogIndexInsert, I'm not sure why that's a big hazard? > I kinda wonder if there's not a third approach hiding somewhere here. We > could just stop updating pg_class in RelationSetNewRelfilenode() in > pg_class, when it's an index on pg_class. Hmm ... are all those indexes mapped? I guess so. But don't we need to worry about resetting relfrozenxid? regards, tom lane