pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: parallel restore sometimes fails for FKs to partitioned tables
Date: Thu, 17 Oct 2019 05:14:25 -0300
Message-ID: <20191017081425.GA18878@alvherre.pgsql> (raw)
In-Reply-To: <20191005224333.GA9738@alvherre.pgsql>

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





view thread (2+ messages)

Message-ID: <20191017081425.GA18878@alvherre.pgsql>
Permalink:  ../20191017081425.GA18878@alvherre.pgsql/
Also on:    postgresql.org/message-id/20191017081425.GA18878@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: parallel restore sometimes fails for FKs to partitioned tables
  In-Reply-To: <20191017081425.GA18878@alvherre.pgsql>

* 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