From: Alvaro Herrera from 2ndQuadrant <alvherre@alvh.no-ip.org>
To: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Cc: Junwang Zhao <zhjwpku@gmail.com>
Cc: Tender Wang <tndrwang@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18559: Crash after detaching a partition concurrently from another session
Date: Tue, 13 Aug 2024 14:18:58 -0400
Message-ID: <202408131818.bltdxziu2jpj@alvherre.pgsql> (raw)
In-Reply-To: <CAGz5QCKGAhdN_Aq109zRAv44nJfZw2Wc6Fx22EZZ-UmX-WGFVg@mail.gmail.com>
On 2024-Aug-13, Kuntal Ghosh wrote:
> That means - after getting the live partitions from
> prune_append_rel_partitions(), by the time the code tries to lock a
> child, it's already dropped.
Right.
> However, similar check is not there in expand_partitioned_rtentry().
> Introducing the same check will fix the issue. But, I don't know how
> it affects the pruning part as this partition couldn't be pruned
> earlier and that's why we're opening the child partition.
Hmm, we could just remove the partition from the set of live partitions
-- then it should behave the same as if the partition had been pruned.
Something like the attached, perhaps.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"In fact, the basic problem with Perl 5's subroutines is that they're not
crufty enough, so the cruft leaks out into user-defined code instead, by
the Conservation of Cruft Principle." (Larry Wall, Apocalypse 6)
Attachments:
0001-Don-t-open-partitions-that-were-detached-and-dropped.patch (text/x-diff, 0B) 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: alvherre@alvh.no-ip.org, kuntalghosh.2007@gmail.com, zhjwpku@gmail.com, tndrwang@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18559: Crash after detaching a partition concurrently from another session
In-Reply-To: <202408131818.bltdxziu2jpj@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