Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, kristianlejao(at)gmail(dot)com
Subject: Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c
Date: 2025-09-23 21:41:45
Message-ID: CAD21AoCD=Fg6cx9HQGY1JUy+ZVd5_k_zTqPn7HjPPL2CjncbHg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Sep 17, 2025 at 5:25 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Wed, Sep 17, 2025 at 07:42:36PM +0900, Etsuro Fujita wrote:
> > The test case you showed upthread and added to the patch is useful, so
> > I think we should add it as well, but my question about it is: is it
> > really a good idea to use injection points?
>
> > Why don't you just use BEGIN/COMMIT statements like this:
> >
> > -- session 1
> > begin isolation level read committed;
> > update a set i = i + 1;
> >
> > -- session 2
> > begin isolation level read committed;
> > select a.i,
> > (select 1 from b, c where a.i = b.i and b.i = c.i)
> > from a
> > for update; -- waits for the transaction in session 1 to complete
> >
> > -- session 1
> > commit;
> >
> > -- session 2
> > select a.i,
> > (select 1 from b, c where a.i = b.i and b.i = c.i)
> > from a
> > for update; -- produces results after doing an EvalPlanQual recheck
> > i | ?column?
> > ---+----------
> > 2 |
> > (1 row)
> >
> > Again, my apologies for the late response.
>
> As far as I can see, this causes the SELECT FOR UPDATE of session 2
> that's waiting for the commit of session 1 to crash, if we don't have
> the fix, of course. Removing the dependency with injection points is
> nice if we don't require it, so we can just tweak the isolation test
> proposed upthread to use the same schema, but the queries you are
> suggesting.

+1

I changed the regression tests and used the fix proposed by
Fujita-san. Please review the attached new version patch.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v3-0001-Fix-assertion-failure-in-postgresGetForeignJoinPa.patch application/octet-stream 5.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2025-09-23 23:39:03 Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c
Previous Message PG Bug reporting form 2025-09-23 16:17:09 BUG #19061: I downloaded version 17 of postgreSQL and it was lagging very much