From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Alex Aktsipetrov <alex.akts@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Andres Freund <andres@anarazel.de>
Subject: Re: BUG #15900: `executor could not find named tuplestore` in triggers with transition table and row locks
Date: Tue, 09 Jul 2019 11:38:13 -0400
Message-ID: <24530.1562686693@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKG+3YYDHn4VzEh9hxbWta3s7dYMQk6bODbz6bYJwpNV=FQ@mail.gmail.com>
References: <15900-bc482754fe8d7415@postgresql.org>
<CALPsoAL2x_C=hMK0M459rijUVcrchjVT6k7vFduP47iCMRh77Q@mail.gmail.com>
<CA+hUKG+HeXeDEPBU-f0ZMViy+=VP5O8FVeLhz7u7BvXtaobv+g@mail.gmail.com>
<CA+hUKG+XHZaCrX81CHwphG-dRTK_dmqWSmzW-vGYGEOGwZJjBw@mail.gmail.com>
<CA+hUKG+3YYDHn4VzEh9hxbWta3s7dYMQk6bODbz6bYJwpNV=FQ@mail.gmail.com>
Thomas Munro <thomas.munro@gmail.com> writes:
> On Tue, Jul 9, 2019 at 1:13 PM Thomas Munro <thomas.munro@gmail.com> wrote:
>> I think it's highly likely that bug #15720 was a case of this bug and
>> would be fixed by this patch.
Agreed. I think your version of the fix is good, and you should
mention #15720 too in the commit message.
>> Alex's repro doesn't work on 11 though,
>> because EPQ is not entered at all. Which raises the question: why do
>> we need to enter EPQ after commit ad0bda5d on 12/master, for a row
>> that hasn't been updated by anyone else?
> Explanation: since ad0bda5d24ea, ExecLockRows() always calls
> EvalPlanQualBegin() which initialises the plan state, and in this case
> ExecInitNamedTuplestoreScan() errors out due to the bug. Before, you
> needed the right concurrency scenario (epq_needed) before we did that,
> as the reporter of bug #15720 discovered.
I'm quite desperately unhappy about this observation, because
EvalPlanQualBegin is a *large* amount of overhead that is usually
unnecessary, and is now going to be paid for *every locked row*
whether there's any conflict on it or not. I do not find that
acceptable. Why is it necessary to do this before finding that
there's an update conflict?
regards, tom lane
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: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, alex.akts@gmail.com, pgsql-bugs@lists.postgresql.org, andres@anarazel.de
Subject: Re: BUG #15900: `executor could not find named tuplestore` in triggers with transition table and row locks
In-Reply-To: <24530.1562686693@sss.pgh.pa.us>
* 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