Re: assert in nested SQL procedure call in current HEAD

From: Andres Freund <andres(at)anarazel(dot)de>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Joe Conway <mail(at)joeconway(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: assert in nested SQL procedure call in current HEAD
Date: 2018-06-27 15:44:18
Message-ID: 20180627154418.ves6jbffp6wfgxfu@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Peter,

On 2018-06-10 21:06:59 +0200, Dmitry Dolgov wrote:
> > On 8 June 2018 at 06:20, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> wrote:
>
> > Joe> My colleague Yogesh Sharma discovered an assert in nested SQL
> > Joe> procedure calls after ROLLBACK is used. Minimal test case and
> > Joe> backtrace below. I have not yet tried to figure out exactly what
> > Joe> is going on beyond seeing that it occurs in pg_plan_query() where
> > Joe> the comment says "Planner must have a snapshot in case it calls
> > Joe> user-defined functions"...
> >
> > Andrew> https://www.postgresql.org/message-id/29608.1518533639@sss.pgh.pa.us
> >
> > I added it to the open items list since nobody else seems to have taken
> > notice; from Tom's linked message it seems this should be Peter E's bag?
>
> I've taken a look at this - indeed, the situation looks similar to what
> described in the linked message, namely after a transaction rollback and
> creation of a new one no active snapshot was pushed. But in this particular
> case the timeframe without an active snapshot is actually limited and includes
> only some initialization and planning activity (after that a new one is
> pushed). The commentary says that "Planner must have a snapshot in case it
> calls user-defined functions." - I tried to simulate this in order to see what
> would happen, but got no errors. Is there a chance that it's an outdated
> Assert?

This hasn't progressed in a while. Peter, since you committed the
relevant change, could you update us please?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2018-06-27 15:49:39 Re: wrong query result with jit_above_cost= 0
Previous Message Pavel Stehule 2018-06-27 15:38:31 Re: effect of JIT tuple deform?