Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juJ2D-0007Zp-Qi for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 17:11:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juJ2B-000626-7o for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 17:11:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juJ2B-00061z-0n for pgsql-hackers@lists.postgresql.org; Sat, 11 Jul 2020 17:11:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juJ28-0005lF-B9 for pgsql-hackers@lists.postgresql.org; Sat, 11 Jul 2020 17:11:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 06BHBQQQ2393680; Sat, 11 Jul 2020 13:11:26 -0400 From: Tom Lane To: Justin Pryzby cc: David Gilman , pgsql-hackers@lists.postgresql.org Subject: Re: "tuple concurrently updated" in pg_restore --jobs In-reply-to: <20200710214521.GS26220@telsasoft.com> References: <20200706050129.GW4107@telsasoft.com> <2116463.1594414480@sss.pgh.pa.us> <20200710210607.GR26220@telsasoft.com> <2164430.1594416988@sss.pgh.pa.us> <20200710214521.GS26220@telsasoft.com> Comments: In-reply-to Justin Pryzby message dated "Fri, 10 Jul 2020 16:45:21 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2393678.1594487486.1@sss.pgh.pa.us> Date: Sat, 11 Jul 2020 13:11:26 -0400 Message-ID: <2393679.1594487486@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Justin Pryzby writes: > On Fri, Jul 10, 2020 at 05:36:28PM -0400, Tom Lane wrote: >> I'm not sure how far to back-patch it -- I think the parallel restore >> of ACLs behavior is not very old, but we might want to teach older >> pg_dump versions to insert the extra dependency anyway, for safety. > Yes, and the test case in David's patch on other thread [0] can't be > backpatched further than this patch is. Actually, the answer seems to be that we'd better back-patch all the way, because this is a live bug much further back than I'd guessed. pg_restore is willing to run these ACL restores in parallel in all active branches. The given test case only shows a failure back to 9.6, because older versions don't dump ACLs on system catalogs; but of course you can just try it with a user table instead. Oddly, I could not get the "tuple concurrently updated" syndrome to appear on 9.5. Not sure why not; the GRANT/REVOKE code looks the same as in 9.6. What I *could* demonstrate in 9.5 is that sometimes the post-restore state is flat out wrong: the column-level grants go missing, presumably as a result of the table-level REVOKE executing after the column-level GRANTs. Probably that syndrome occurs sometimes in later branches too, depending on timing; but I didn't look. regards, tom lane