Re: crash in plancache with subtransactions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: crash in plancache with subtransactions
Date
Msg-id 7979.1287700567@sss.pgh.pa.us
Whole thread Raw
In response to crash in plancache with subtransactions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: crash in plancache with subtransactions
Re: crash in plancache with subtransactions
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> A customer was hitting some misbehavior in one of their internal tests and
> I tracked it down to plancache not behaving properly with
> subtransactions: in particular, a plan is not being marked "dead" when
> the subtransaction on which it is planned rolls back.

I don't believe that it's plancache's fault; the real problem is that
plpgsql is keeping "simple expression" execution trees around longer
than it should.  Your patch masks the problem by forcing those trees to
be rebuilt, but it's the execution trees not the plan trees that contain
stale data.

I'm not immediately sure why plpgsql_subxact_cb is failing to clean up
correctly in this example, but that seems to be where to look.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Timeout and wait-forever in sync rep
Next
From: Bruce Momjian
Date:
Subject: Re: docs on contrib modules that can't pg_upgrade?