From: Michael Paquier <michael@paquier.xyz>
To: Bossart, Nathan <bossartn@amazon.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Alexey Ermakov <alexey.ermakov@dataegret.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Peter Geoghegan <pg@bowt.ie>
Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently
Date: Wed, 8 Dec 2021 11:48:37 +0900
Message-ID: <YbAdBT749O7ylwGS@paquier.xyz> (raw)
In-Reply-To: <BC0B973C-AD3A-4163-866D-9AF8F2226174@amazon.com>
References: <B706E617-2172-4460-845A-B76E5DB2E0A2@anarazel.de>
<YYoA24hSkx6EYWpx@paquier.xyz>
<20211109050848.oe3u6mhtomkaoxrx@alap3.anarazel.de>
<20211109054625.GB940092@rfd.leadboat.com>
<20211109063119.ukcvdk7uvz7ks3pa@alap3.anarazel.de>
<20211109064217.GC940092@rfd.leadboat.com>
<YYzd3dsYi/LiwWuc@paquier.xyz>
<YZI+aNEnnpBASxNU@paquier.xyz>
<Ya1tKYLozbcvw5Dw@paquier.xyz>
<BC0B973C-AD3A-4163-866D-9AF8F2226174@amazon.com>
On Tue, Dec 07, 2021 at 10:04:54PM +0000, Bossart, Nathan wrote:
> I confirmed that the new tests reliably produce corruption and that
> the suggested fix resolves it. I also lean towards the simple
> solution, but I do wonder if it creates any interesting side effects.
Thanks.
> For example, could holding the locks longer impact performance?
Do you have anything particular in mind? It seems to me that this
boils down to the same lock taken on the parent table based on its
RTE.
> - toast_close_indexes(toastidxs, num_indexes, RowExclusiveLock);
> - table_close(toastrel, RowExclusiveLock);
> + toast_close_indexes(toastidxs, num_indexes, NoLock);
> + table_close(toastrel, NoLock);
>
> I think it would be good to expand the comments above these changes to
> explain why we are keeping the lock. That might help avoid similar
> problems in the future.
Yes, I have added a note, and applied the patch after looking at it
again this morning. The test cannot be used in 12 so I have removed
it from REL_12_STABLE, as allow_system_table_mods is a PGC_POSTMASTER
there.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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-bugs@postgresql.org
Cc: michael@paquier.xyz, bossartn@amazon.com, noah@leadboat.com, andres@anarazel.de, alexey.ermakov@dataegret.com, robertmhaas@gmail.com, maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org, pg@bowt.ie
Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently
In-Reply-To: <YbAdBT749O7ylwGS@paquier.xyz>
* 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