Re: parallel restore sometimes fails for FKs to partitioned tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: parallel restore sometimes fails for FKs to partitioned tables
Date
Msg-id 20191017081425.GA18878@alvherre.pgsql
Whole thread Raw
In response to parallel restore sometimes fails for FKs to partitioned tables  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 2019-Oct-05, Alvaro Herrera wrote:

> While playing around I noticed that depending on the number of parallel
> workers in pg_restore compared to the number of partitions a table has,
> restoring an FK fails because the FK itself is restored before the index
> partitions have completed restoring.  The exact conditions to cause the
> failure seem to vary depending on whether the dump is schema-only or not.
> 
> This can seemingly be fixed by having pg_dump make the constraint depend
> on the attach of each partition, as in the attached patch.  With this
> patch I no longer see failures.

Pushed with some additional tweaks.

Parallel restore of partitioned tables containing data and unique keys
still fails with some deadlock errors, though :-(

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Remaining calls of heap_close/heap_open in the tree
Next
From: Tom Lane
Date:
Subject: Re: Remaining calls of heap_close/heap_open in the tree