From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: During heap rebuild, lock any TOAST index until end of transacti
Date: Sat, 21 Mar 2020 16:45:57 +0000
Message-ID: <E1jFhG1-0000Uq-Co@gemulon.postgresql.org> (raw)
During heap rebuild, lock any TOAST index until end of transaction.
swap_relation_files() calls toast_get_valid_index() to find and lock
this index, just before swapping with the rebuilt TOAST index. The
latter function releases the lock before returning. Potential for
mischief is low; a concurrent session can issue ALTER INDEX ... SET
(fillfactor = ...), which is not alarming. Nonetheless, changing
pg_class.relfilenode without a lock is unconventional. Back-patch to
9.5 (all supported versions), because another fix needs this.
Discussion: https://postgr.es/m/20191226001521.GA1772687@rfd.leadboat.com
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/88b3a6cd262344f5de64eab31804a0f39a7c6337
Modified Files
--------------
src/backend/access/heap/tuptoaster.c | 4 ++--
src/backend/commands/cluster.c | 2 +-
2 files changed, 3 insertions(+), 3 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: noah@leadboat.com
Subject: Re: pgsql: During heap rebuild, lock any TOAST index until end of transacti
In-Reply-To: <E1jFhG1-0000Uq-Co@gemulon.postgresql.org>
References: <E1jFhG1-0000Uq-Co@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