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 1hLyr6-0003i1-41 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 May 2019 23:41:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLyr3-0006LD-U9 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 May 2019 23:41:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLyr3-0006K3-Jx for pgsql-hackers@lists.postgresql.org; Wed, 01 May 2019 23:41:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLyqw-0003rf-Ou for pgsql-hackers@lists.postgresql.org; Wed, 01 May 2019 23:41:37 +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 x41NfPQq016044; Wed, 1 May 2019 19:41:25 -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: <5483.1556737736@sss.pgh.pa.us> References: <16277.1556649660@sss.pgh.pa.us> <20190430190308.kga2z5oz7vab7w22@alap3.anarazel.de> <17996.1556651503@sss.pgh.pa.us> <20190430221045.6slpi2vm2noda5jb@alap3.anarazel.de> <28313.1556663080@sss.pgh.pa.us> <28926.1556664156@sss.pgh.pa.us> <20190430225307.lvfvcf2776iywhw4@alap3.anarazel.de> <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> Comments: In-reply-to Tom Lane message dated "Wed, 01 May 2019 15:08:56 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16042.1556754084.1@sss.pgh.pa.us> Date: Wed, 01 May 2019 19:41:24 -0400 Message-ID: <16043.1556754084@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Andres Freund writes: >> On 2019-05-01 10:06:03 -0700, Andres Freund wrote: >>> I'm not sure this is the right short-term answer. Why isn't it, for now, >>> sufficient to do what I suggested with RelationSetNewRelfilenode() not >>> doing the CommandCounterIncrement(), and reindex_index() then doing the >>> SetReindexProcessing() before a CommandCounterIncrement()? That's like >>> ~10 line code change, and a few more with comments. > That looks like a hack to me... > The main thing I'm worried about right now is that I realized that > our recovery from errors in this area is completely hosed, cf > https://www.postgresql.org/message-id/4541.1556736252@sss.pgh.pa.us OK, so per the other thread, it seems like the error recovery problem isn't going to affect this directly. However, I still don't like this proposal much; the reason being that it's a rather fundamental change in the API of RelationSetNewRelfilenode. This will certainly break any external callers of that function --- and silently, too. Admittedly, there might not be any outside callers, but I don't really like that assumption for something we're going to have to back-patch. The solution I'm thinking of should have much more localized effects, basically just in reindex_index and RelationSetNewRelfilenode, which is why I like it better. regards, tom lane