Re: Use of ActiveSnapshot

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Use of ActiveSnapshot
Date: 2007-05-14 16:42:01
Message-ID: 46489159.1030208@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/12/2007 4:53 PM, Jan Wieck wrote:
> Either calling pg_plan_queries() with needSnapshot=false or saving and
> restoring ActiveSnapshot will prevent the backend from dumping core in
> the mentioned example, but I am not entirely sure as to which one is the
> right solution.

Attached is a self contained example that crashes the current backend.
It took me a moment to figure out exactly how to reproduce it. The
problem occurs when the query that needs replanning is actually a

FOR record IN SELECT ...

that is inside of a nested function call. In that case, the revalidation
of the saved plan actually happens inside of SPI_cursor_open(), which
does not save and restore the ActiveSnapshot. Shouldn't it?

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

Attachment Content-Type Size
t1.sql text/plain 631 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2007-05-14 16:45:25 Re: Concurrent psql patch
Previous Message Andrew Dunstan 2007-05-14 16:39:08 Re: What is happening on buildfarm member baiji?