Re: More parallel pg_dump bogosities
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Stephen Frost <sfrost@snowman.net>, pgsql-hackers@lists.postgresql.org
Date: 2018-08-28T22:22:43Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2018-Aug-28, Tom Lane wrote:
>> Doesn't pg_backup_archiver.c's identify_locking_dependencies() need to
>> treat POLICY and ROW SECURITY items as requiring exclusive lock on
>> the referenced table? Those commands definitely acquire
>> AccessExclusiveLock in a quick test.
> I hadn't come across this locking dependency before, so it's pretty
> likely that partitioned index attachment has a problem here.
Hm, it looks like
ALTER INDEX public.at_partitioned_a_idx ATTACH PARTITION public.at_part_1_a_idx;
takes these locks:
relation | mode
----------------------+---------------------
at_part_1 | AccessShareLock
at_partitioned | AccessShareLock
at_part_1_a_idx | AccessExclusiveLock
at_partitioned_a_idx | AccessExclusiveLock
I'm not aware of exactly what this does to catalog entries, but is it
*really* safe to have only AccessShareLock on the tables? That sounds
like a bit of wishful thinking :-(.
In any case, the exclusive locks on the indexes are likely sufficient
to block other operations on the tables (maybe leading to deadlocks),
so I'm inclined to think that yeah, parallel restore should refrain
from running this in parallel with other DDL on either table.
regards, tom lane
Commits
-
Make pg_restore's identify_locking_dependencies() more bulletproof.
- e2841d399a89 10.6 landed
- e0a0cc28d082 12.0 landed
- aac21f11df0d 9.5.15 landed
- 97aa524f18c0 9.6.11 landed
- 49841edcc644 11.0 landed
-
Code review for pg_dump's handling of ALTER INDEX ATTACH PARTITION.
- 8cff4f5348d0 12.0 landed
- 18f6258e5ee8 11.0 landed
-
Fix missing dependency for pg_dump's ENABLE ROW LEVEL SECURITY items.
- cbdca00bef59 12.0 landed
- c5e235ff8ad0 11.0 landed
- 3998e55af050 9.5.15 landed
- 173df4cd36df 9.6.11 landed
- 0f3dd76f527d 10.6 landed