Skip to content

Commit c5c1cc3

Browse files
committed
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. Thomas Hallgren
1 parent be1cc69 commit c5c1cc3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/backend/utils/mmgr/portalmem.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.78 2005/04/11 19:51:15 tgl Exp $
15+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.79 2005/05/11 18:05:37 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -475,12 +475,6 @@ CommitHoldablePortals(void)
475475
*
476476
* Remove all non-holdable portals created in this transaction.
477477
* Portals remaining from prior transactions should be left untouched.
478-
*
479-
* XXX This assumes that portals can be deleted in a random order, ie,
480-
* no portal has a reference to any other (at least not one that will be
481-
* exercised during deletion). I think this is okay at the moment, but
482-
* we've had bugs of that ilk in the past. Keep a close eye on cursor
483-
* references...
484478
*/
485479
void
486480
AtCommit_Portals(void)
@@ -516,6 +510,9 @@ AtCommit_Portals(void)
516510

517511
/* Zap all non-holdable portals */
518512
PortalDrop(portal, true);
513+
514+
/* Restart the iteration */
515+
hash_seq_init(&status, PortalHashTable);
519516
}
520517
}
521518

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy