summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-02-15 16:18:39 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-02-15 16:18:39 -0500
commit04a0231e56c4f401b681fe8a87829b4d11cd18ce (patch)
tree1b50d8550543f021888a27913039c06792a70f6f /src/include
parent421513ba84a0efb4a6690c5a2e1062947804e4d3 (diff)
Run a portal's cleanup hook immediately when pushing it to FAILED state.
This extends the changes of commit 6252c4f9e201f619e5eebda12fa867acd4e4200e so that we run the cleanup hook earlier for failure cases as well as success cases. As before, the point is to avoid an assertion failure from an Assert I added in commit a874fe7b4c890d1fe3455215a83ca777867beadd, which was meant to check that no user-written code can be called during portal cleanup. This fixes a case reported by Pavan Deolasee in which the Assert could be triggered during backend exit (see the new regression test case), and also prevents the possibility that the cleanup hook is run after portions of the portal's state have already been recycled. That doesn't really matter in current usage, but it foreseeably could matter in the future. Back-patch to 9.1 where the Assert in question was added.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/portal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h
index 6af1cd5b106..cf50655e125 100644
--- a/src/include/utils/portal.h
+++ b/src/include/utils/portal.h
@@ -207,6 +207,7 @@ extern Portal CreateNewPortal(void);
extern void PinPortal(Portal portal);
extern void UnpinPortal(Portal portal);
extern void MarkPortalDone(Portal portal);
+extern void MarkPortalFailed(Portal portal);
extern void PortalDrop(Portal portal, bool isTopCommit);
extern Portal GetPortalByName(const char *name);
extern void PortalDefineQuery(Portal portal,