Re: BUG #5906: assertion failure in AtCleanup_Portals

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: YAMAMOTO Takashi <yamt(at)mwd(dot)biglobe(dot)ne(dot)jp>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5906: assertion failure in AtCleanup_Portals
Date: 2011-03-03 16:55:37
Message-ID: 9890.1299171337@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com> writes:
> On Thu, Mar 3, 2011 at 09:14, YAMAMOTO Takashi <yamt(at)mwd(dot)biglobe(dot)ne(dot)jp> wrote:
>> here's a small test case.

> I was able to reproduce the assertion failure.

> It looks we call CreatePortal for ROLLBACK, but don't invoke
> DropPortal nor AtAbort_Portals before AtCleanup_Portals.

Hmm. The reason why not is that xact.c is already in TBLOCK_ABORT_END
state, ie, it knows it already did AbortTransaction and doesn't see a
need to do it again. So the portal running ROLLBACK doesn't get
cleaned up by AtAbort_Portals.

We could revert the addition of the "cleanup == NULL" assert in
AtCleanup_Portals, but I'm still feeling that that assertion is a good
thing. Maybe the cleanest fix is to have PortalRun do something to run
the cleanup hook where it does this:

/* Prevent portal's commands from being re-executed */
portal->status = PORTAL_DONE;

That should be a safe-enough place to run cleanup.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2011-03-03 17:05:05 Re: BUG #5863: help message report 5433 as default port
Previous Message David Schmitt 2011-03-03 16:51:13 Re: BUG #5869: postgresql corrupts unquoted non-ascii chars in column aliases