pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid trying to restore table ACLs and per-column ACLs in parall
Date: Sat, 11 Jul 2020 17:37:21 +0000
Message-ID: <E1juJRB-0007Pv-Pv@gemulon.postgresql.org> (raw)

Avoid trying to restore table ACLs and per-column ACLs in parallel.

Parallel pg_restore has always supposed that ACL items for different
objects are independent and can be restored in parallel without
conflicts.  However, there is one case where this fails: because
REVOKE on a table is defined to also revoke the privilege(s) at
column level, we can't restore per-column ACLs till after we restore
any table-level privileges on their table.  Failure to honor this
restriction can lead to "tuple concurrently updated" errors during
parallel restore, or even to the per-column ACLs silently disappearing
because the table-level REVOKE is executed afterwards.

To fix, add a dependency from each column-level ACL item to its table's
ACL item, if there is one.  Note that this doesn't fix the hazard
for pre-existing archive files, only for ones made with a corrected
pg_dump.  Given that the bug's been there quite awhile without
field reports, I think this is acceptable.

This requires changing the API of pg_dump's dumpACL() function.
To keep its argument list from getting even longer, I removed the
"CatalogId objCatId" argument, which has been unused for ages.

Per report from Justin Pryzby.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/20200706050129.GW4107@telsasoft.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4fdc559c88eb53ba12fc4c59a633d2bee0dbf8a2

Modified Files
--------------
src/bin/pg_dump/common.c    |  2 +-
src/bin/pg_dump/pg_backup.h |  6 ++++
src/bin/pg_dump/pg_dump.c   | 81 +++++++++++++++++++++++++++++----------------
3 files changed, 59 insertions(+), 30 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1juJRB-0007Pv-Pv@gemulon.postgresql.org>
Permalink:  ../E1juJRB-0007Pv-Pv@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1juJRB-0007Pv-Pv@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Avoid trying to restore table ACLs and per-column ACLs in parall
  In-Reply-To: <E1juJRB-0007Pv-Pv@gemulon.postgresql.org>
  References: <E1juJRB-0007Pv-Pv@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox