Re: Patch that deals with that AtCommit_Portals encounters

Поиск
Список
Период
Сортировка
Искать
От
Bruce Momjian
Тема
Re: Patch that deals with that AtCommit_Portals encounters
Дата
в 15:05:15
Msg-id
200505111805.j4BI59c03000@candle.pha.pa.us
Ответ на
Список
Дерево обсуждения
Patch that deals with that AtCommit_Portals encounters deleted entries Thomas Hallgren <thhal@mailblocks.com>
Re: Patch that deals with that AtCommit_Portals encounters Bruce Momjian <pgman@candle.pha.pa.us>
Re: Patch that deals with that AtCommit_Portals encounters Bruce Momjian <pgman@candle.pha.pa.us>
Re: Patch that deals with that AtCommit_Portals encounters Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch that deals with that AtCommit_Portals encounters Thomas Hallgren <thhal@mailblocks.com>
Re: Patch that deals with that AtCommit_Portals encounters Neil Conway <neilc@samurai.com>
Re: Patch that deals with that AtCommit_Portals encounters Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch that deals with that AtCommit_Portals encounters Thomas Hallgren <thhal@mailblocks.com>
Re: Patch that deals with that AtCommit_Portals encounters Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch that deals with that AtCommit_Portals encounters Thomas Hallgren <thhal@mailblocks.com>
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.

I have applied the following patch.  I assume it is too risky for
backpatch to 8.0.X.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/utils/mmgr/portalmem.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v
retrieving revision 1.78
diff -c -c -r1.78 portalmem.c
*** src/backend/utils/mmgr/portalmem.c	11 Apr 2005 19:51:15 -0000	1.78
--- src/backend/utils/mmgr/portalmem.c	11 May 2005 18:03:38 -0000
***************
*** 475,486 ****
   *
   * Remove all non-holdable 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)
--- 475,480 ----
***************
*** 516,521 ****
--- 510,518 ----
  
  		/* Zap all non-holdable portals */
  		PortalDrop(portal, true);
+ 
+ 		/* Restart the iteration */
+ 		hash_seq_init(&status, PortalHashTable);
  	}
  }
  
В списке pgsql-patches по дате отправления
От: Bruce Momjian
Дата:
От: Bruce Momjian
Дата:
FAQ