public inbox for [email protected]
help / color / mirror / Atom feedFrom: Amit Langote <[email protected]>
To: David Rowley <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Jacob Champion <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: generic plans and "initial" pruning
Date: Mon, 20 May 2024 21:13:21 +0900
Message-ID: <CA+HiwqEqLozRitnPZMs6kWWkvb6DgtSPKH9TbZhvtbCXJJa7Mg@mail.gmail.com> (raw)
In-Reply-To: <CAApHDvq0rDbt6o7mvgU8gf1VJ3hvE2sOGdhVDRTKxq5parmA6w@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<[email protected]>
<CAApHDvq0rDbt6o7mvgU8gf1VJ3hvE2sOGdhVDRTKxq5parmA6w@mail.gmail.com>
On Sun, May 19, 2024 at 9:39 AM David Rowley <[email protected]> wrote:
> For #1, the locks taken for SELECT queries are less likely to conflict
> with other locks obtained by PostgreSQL, but at least at the moment if
> someone is getting deadlocks with a DDL type operation, they can
> change their query or DDL script so that locks are taken in the same
> order. If we allowed executor startup to do this then if someone
> comes complaining that PG18 deadlocks when PG17 didn't we'd just have
> to tell them to live with it. There's a comment at the bottom of
> find_inheritance_children_extended() just above the qsort() which
> explains about the deadlocking issue.
Thought to chime in on this.
A deadlock may occur with the execution-time locking proposed in the
patch if the DDL script makes assumptions about how a cached plan's
execution determines the locking order for children of multiple parent
relations. Specifically, the deadlock can happen if the script tries
to lock the child relations directly, instead of locking them through
their respective parent relations. The patch doesn't change the order
of locking of relations mentioned in the query, because that's defined
in AcquirePlannerLocks().
--
Thanks, Amit Langote
view thread (22+ messages)
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: generic plans and "initial" pruning
In-Reply-To: <CA+HiwqEqLozRitnPZMs6kWWkvb6DgtSPKH9TbZhvtbCXJJa7Mg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox