From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Retain locks after marking the partitioned index valid
Date: Sun, 25 Oct 2026 09:24:35 +0000
Message-ID: <E1xKuSx-00000000gFO-2sph@gemulon.postgresql.org> (raw)
Retain locks after marking the partitioned index valid
Commit 8b08f7d4820f (pg11-era), for no apparent reason, made
validatePartitionedIndex() release the locks on the parent partitioned
index and table when marking the parent index valid after marking the
index partition as valid. This leads to race condition, which
particularly manifest when restoring from pg_dump in parallel mode, for
instance causing restore of FKs to fail if the PK that they depend on is
being concurrently validated. Fix by retaining those locks until
transaction commit, as we normally do everywhere in DDL code.
Per buildfarm failures.
Author: Andrey Borodin <x4mmm@yandex-team.ru> (in absentia)
Diagnosed-by: Kirill Reshke <reshkekirill@gmail.com>
Backpatch-through: 14
Discussion: https://postgr.es/m/l4joqljvbou26unhplkdj7m5olxn7rsy2loqlcta44nie5k3bs@zudmva7han7g
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/9ab37b6e7cd4875d9196f59c93166b427b3394a4
Modified Files
--------------
src/backend/commands/tablecmds.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
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: alvherre@kurilemu.de
Subject: Re: pgsql: Retain locks after marking the partitioned index valid
In-Reply-To: <E1xKuSx-00000000gFO-2sph@gemulon.postgresql.org>
References: <E1xKuSx-00000000gFO-2sph@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