Re: pg_restore causing deadlocks on partitioned tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_restore causing deadlocks on partitioned tables
Date
Msg-id 1032969.1600097091@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_restore causing deadlocks on partitioned tables  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: pg_restore causing deadlocks on partitioned tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2020-Sep-14, Tom Lane wrote:
>> Hm, this seems related to 2ba5b2db7, but not the same thing.
>> Alvaro, any thoughts?

> So apparently when we go to restore the table data for the partition,
> the TRUNCATE deadlocks with the PK addition ... that's pretty odd;
> shouldn't the constraint restore have waited until the data had been
> fully loaded?

Yeah, that's certainly the design expectation.  Missing dependency?

If memory serves, which it may not given my undercaffeinated state,
we would not expect there to be a direct dependency link between the
constraint and the table data "object".  What there should be is
dependencies forcing the data to be restored before the post-data
boundary pseudo-object, and the constraint after the boundary.
I'm half guessing that that's being mucked up for partitioned tables.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Subscription test 013_partition.pl fails under CLOBBER_CACHE_ALWAYS
Next
From: Konstantin Knizhnik
Date:
Subject: Re: On login trigger: take three