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

From Alvaro Herrera
Subject Re: crash in plancache with subtransactions
Date
Msg-id 1287701882-sup-6965@alvh.no-ip.org
Whole thread Raw
In response to Re: crash in plancache with subtransactions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: crash in plancache with subtransactions
List pgsql-hackers
Excerpts from Tom Lane's message of jue oct 21 19:36:07 -0300 2010:
> 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.

Ahh, this probably explains why I wasn't been able to reproduce the
problem without involving subxacts, or prepared plans, that seemed to
follow mostly the same paths around plancache cleanup.

It's also the likely cause that this hasn't ben reported earlier.

> 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.

Will take a look ... if the girls let me ...

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_rawdump
Next
From: "Kevin Grittner"
Date:
Subject: Re: Serializable snapshot isolation patch