Re: crash in plancache with subtransactions
Alvaro Herrera <alvherre@commandprompt.com>
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-10-29T15:40:47Z
Lists: pgsql-hackers
Excerpts from Tom Lane's message of mié oct 27 18:18:06 -0300 2010: > I wrote: > >> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes: > >>> One simple idea is to keep a flag along with the executor state to > >>> indicate that the executor state is currently in use. Set it just before > >>> calling ExecEvalExpr, and reset afterwards. If the flag is already set > >>> in the beginning of exec_eval_simple_expr, we have recursed, and must > >>> create a new executor state. > > >> Yeah, the same thought occurred to me in the shower this morning. > >> I'm concerned about possible memory leakage during repeated recursion, > >> but maybe that can be dealt with. > > I spent quite a bit of time trying to deal with the memory-leakage > problem without adding still more bookkeeping overhead. It wasn't > looking good, and then I had a sudden insight: if we see that the in-use > flag is set, we can simply return FALSE from exec_eval_simple_expr. I tried the original test cases that were handed to me (quite different from what I submitted here) and they are fixed also. Thanks. -- Álvaro Herrera <alvherre@commandprompt.com> The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support