Re: Patch that deals with that AtCommit_Portals encounters

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Patch that deals with that AtCommit_Portals encounters
Date: 2005-04-25 03:39:05
Message-ID: 200504250339.j3P3d5Z04252@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

Thomas Hallgren wrote:
> This patch will ensure that the hash table iteration performed by
> AtCommit_Portals is restarted when a portal is deleted. This is
> necessary since the deletion of a portal may cause the deletion of
> another which on rare occations may cause the iterator to return a
> deleted portal an thus a renewed attempt delete.
>
> Regards,
> Thomas Hallgren
>

> Index: src/backend/utils/mmgr/portalmem.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v
> retrieving revision 1.76.4.1
> diff -u -r1.76.4.1 portalmem.c
> --- src/backend/utils/mmgr/portalmem.c 26 Jan 2005 23:20:37 -0000 1.76.4.1
> +++ src/backend/utils/mmgr/portalmem.c 27 Feb 2005 18:12:49 -0000
> @@ -418,12 +418,6 @@
> * materialized form, since we are going to close down the executor and
> * release locks. Remove all other portals created in this transaction.
> * Portals remaining from prior transactions should be left untouched.
> - *
> - * XXX This assumes that portals can be deleted in a random order, ie,
> - * no portal has a reference to any other (at least not one that will be
> - * exercised during deletion). I think this is okay at the moment, but
> - * we've had bugs of that ilk in the past. Keep a close eye on cursor
> - * references...
> */
> void
> AtCommit_Portals(void)
> @@ -489,6 +483,9 @@
> {
> /* Zap all non-holdable portals */
> PortalDrop(portal, true);
> +
> + /* Restart the iteration */
> + hash_seq_init(&status, PortalHashTable);
> }
> }
> }

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-04-25 04:40:10 Re: Cleaning up unreferenced table files
Previous Message Qingqing Zhou 2005-04-25 01:39:59 Re: revise a comment in CreateCheckPoint()