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 1jsJGB-0006Sw-UC for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2020 05:01:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jsJGA-0001N1-3r for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jul 2020 05:01:42 +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 1jsJG9-0001Mu-MV for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2020 05:01:41 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jsJG1-0001dk-OR for pgsql-hackers@lists.postgresql.org; Mon, 06 Jul 2020 05:01:39 +0000 Received: by mail-io1-xd42.google.com with SMTP id v8so37911495iox.2 for ; Sun, 05 Jul 2020 22:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Ga24pvSTocf4BNcdZG3+IrLGzSlGgq8I8qnfdDJ/Kn4=; b=LHXFgj2erZOPO7gFiL7J9kIjbU3WPGxP/4C2lyQ8JW3iBsfc0p11mxVKBTYVc5HFLe 8QMNnS+oTtlzYdq2Cny2foH7q2Z6+r14GKxEAljuMwIoMe6v0OQv/mZX5613gCx4Eg4f MnAlYq/b98SHoi6TkMBsiyxJFRkdRt9tV3rntz2Dmhn8TUkCBKY9YAA6PZOjK+iQ7Kbm wtPSiuMF/ymTaR3bk34qsjFHGNTvMddxiS5eVEnfxGcZ4DPmDAFs5RSszg914kkblyLs gHtZBYGADicnjVBOqw1stQbVDbo+6BL5RqAOqoB58iTk8Iw+8xaqegj4IwYIsFXBBm+h xiaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=Ga24pvSTocf4BNcdZG3+IrLGzSlGgq8I8qnfdDJ/Kn4=; b=eS+Cic6BuPVgRqgSh1J4gxZ521EuUb/CQCoiAG2Cr4kdl0BKHOLb9gcCgJDbObibbU sgD+DpsaTrKiLScFwXouvglsAg4kPInZ7FMdWDP05OR2Q7C+HDgyRIZMr6tVZ31wgGUG wifUth5KR+YflUFcZ7w836NmQEZDs8fwG/lGDKuaLlBhcEZ8qn6ND/aZpxJSMQL7HO8c dJxWABnvoga6gpPMXYNIdAS6Gx4v24w2mlxEU+GMISMhWnNpbfbLDlPyHf0G+dgv9SUk kigFwivhIIPIhsI3m9JIB+YQKwQtggcSrWhtNPFoCXCYv3W0Jdeu3y3RlDK7a3VLuAkP x7eg== X-Gm-Message-State: AOAM531tvShgLVg051zXcwcUxXTuZoCHkFQArRfAaUq3PnmvVHCZu/HF FNOv7Dv3casze/1+tosA7fKExog2BSk= X-Google-Smtp-Source: ABdhPJyU0FGemOzhTv5jIqkp98CcaTdGNna+JbJPwgvgRy+0uX7T/kq97WLsZZPXPgdP5WBUhg9PoA== X-Received: by 2002:a6b:bc41:: with SMTP id m62mr22677773iof.95.1594011692601; Sun, 05 Jul 2020 22:01:32 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id k126sm9942179iof.50.2020.07.05.22.01.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jul 2020 22:01:31 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 8F722800138; Mon, 6 Jul 2020 00:01:29 -0500 (CDT) Date: Mon, 6 Jul 2020 00:01:29 -0500 From: Justin Pryzby To: David Gilman Cc: pgsql-hackers@lists.postgresql.org Subject: "tuple concurrently updated" in pg_restore --jobs Message-ID: <20200706050129.GW4107@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I hit this issue intermittently (roughly half the time) while working with a patch David submitted, and finally found a recipe to reproduce it on an unpatched v12 instance. I was surprised to see pg_restore -j2 is restoring ACLs in pre-data in parallel. Note different session IDs and PIDs: 2020-07-05 23:31:27.448 CDT,"pryzbyj","secondary_dump",24037,"[local]",5f02a91f.5de5,70,,LOG,00000,"statement: REVOKE SELECT ON TABLE pg_catalog.pg_proc FROM PUBLIC; ",,,,,,,,,"pg_restore","client backend" 2020-07-05 23:31:27.448 CDT,"pryzbyj","secondary_dump",24036,"[local]",5f02a91f.5de4,78,,LOG,00000,"statement: GRANT SELECT(tableoid) ON TABLE pg_catalog.pg_proc TO PUBLIC; ",,,,,,,,,"pg_restore","client backend" 2020-07-05 23:31:27.450 CDT,"pryzbyj","secondary_dump",24036,"[local]",5f02a91f.5de4,79,,LOG,00000,"statement: GRANT SELECT(oid) ON TABLE pg_catalog.pg_proc TO PUBLIC; ",,,,,,,,,"pg_restore","client backend" 2020-07-05 23:31:27.450 CDT,"pryzbyj","secondary_dump",24037,"[local]",5f02a91f.5de5,71,,ERROR,XX000,"tuple concurrently updated",,,,,,"REVOKE SELECT ON TABLE pg_catalog.pg_proc FROM PUBLIC; postgres=# CREATE DATABASE pryzbyj; postgres=# \c pryzbyj pryzbyj=# REVOKE ALL ON pg_proc FROM postgres; pryzbyj=# GRANT SELECT (tableoid, oid, proname) ON pg_proc TO public; pryzbyj=# \dp+ pg_catalog.pg_proc Schema | Name | Type | Access privileges | Column privileges | Policies ------------+---------+-------+-------------------+-------------------+---------- pg_catalog | pg_proc | table | =r/postgres | tableoid: +| | | | | =r/postgres +| | | | | oid: +| | | | | =r/postgres +| | | | | proname: +| | | | | =r/postgres | [pryzbyj@database ~]$ pg_dump pryzbyj -Fc -f pg_dump.out [pryzbyj@database ~]$ pg_restore pg_dump.out -j2 -d pryzbyj --clean -v ... pg_restore: entering main parallel loop pg_restore: launching item 3744 ACL TABLE pg_proc pg_restore: launching item 3745 ACL COLUMN pg_proc.proname pg_restore: creating ACL "pg_catalog.TABLE pg_proc" pg_restore: creating ACL "pg_catalog.COLUMN pg_proc.proname" pg_restore:pg_restore: while PROCESSING TOC: finished item 3745 ACL COLUMN pg_proc.proname pg_restore: from TOC entry 3744; 0 0 ACL TABLE pg_proc postgres pg_restore: error: could not execute query: ERROR: tuple concurrently updated Command was: REVOKE ALL ON TABLE pg_catalog.pg_proc FROM postgres;