Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmn4h-0003mf-Ai for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Aug 2018 21:29:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fmn4f-0008Me-3f for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Aug 2018 21:29:57 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmn4e-0008MX-U2 for pgsql-bugs@lists.postgresql.org; Mon, 06 Aug 2018 21:29:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmn4b-0006ER-2O for pgsql-bugs@lists.postgresql.org; Mon, 06 Aug 2018 21:29:56 +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 w76LTnaj013229; Mon, 6 Aug 2018 17:29:49 -0400 From: Tom Lane To: Peter Geoghegan cc: deathlock13@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #15309: ERROR: catalog is missing 1 attribute(s) for relid 760676 when max_parallel_maintenance_workers > 0 In-reply-to: References: <153329671686.1405.18298309097348420351@wrigleys.postgresql.org> <11288.1533304389@sss.pgh.pa.us> Comments: In-reply-to Peter Geoghegan message dated "Mon, 06 Aug 2018 14:21:33 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13227.1533590989.1@sss.pgh.pa.us> Date: Mon, 06 Aug 2018 17:29:49 -0400 Message-ID: <13228.1533590989@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Geoghegan writes: > Sure enough, that's what the bug is - a few debugging calls to > RelationMapFilenodeToOid() within nbtsort.c proves it. Several > approaches to fixing the bug occur to me: > * Ban parallel CREATE INDEX for all catalogs. This was how things were > up until several weeks before the original patch was committed. > * Ban parallel CREATE INDEX for mapped catalogs only. > * Find a way to propagate the state necessary to have parallel workers > agree with the leader on the correct relfilenode. > We could probably propagate backend-local state like > active_local_updates without too much difficulty, which looks like it > would fix the problem. Note that we did something very similar with > reindex-pending-indexes lists in commit 29d58fd3. That commit > similarly involved propagating more backend-local state so that > parallel index builds (or at least REINDEX) on catalogs could be > enabled/work reliably. Maybe we should continue down the road of > making parallel builds work on catalogs, on general principle. Hm. Post-beta3, I think I'd vote for a conservative fix in v11, which seems to be "ban for mapped catalogs". Feel free to make it work in HEAD, though. regards, tom lane