Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
41baee7a
Commit
41baee7a
authored
9 years ago
by
Noah Misch
Browse files
Options
Downloads
Patches
Plain Diff
Comment on dead code in AtAbort_Portals() and AtSubAbort_Portals().
Reviewed by Tom Lane and Robert Haas.
parent
f4aa3a18
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/utils/mmgr/portalmem.c
+16
-4
16 additions, 4 deletions
src/backend/utils/mmgr/portalmem.c
with
16 additions
and
4 deletions
src/backend/utils/mmgr/portalmem.c
+
16
−
4
View file @
41baee7a
...
@@ -765,7 +765,14 @@ AtAbort_Portals(void)
...
@@ -765,7 +765,14 @@ AtAbort_Portals(void)
{
{
Portal
portal
=
hentry
->
portal
;
Portal
portal
=
hentry
->
portal
;
/* Any portal that was actually running has to be considered broken */
/*
* See similar code in AtSubAbort_Portals(). This would fire if code
* orchestrating multiple top-level transactions within a portal, such
* as VACUUM, caught errors and continued under the same portal with a
* fresh transaction. No part of core PostgreSQL functions that way.
* XXX Such code would wish the portal to remain ACTIVE, as in
* PreCommit_Portals().
*/
if
(
portal
->
status
==
PORTAL_ACTIVE
)
if
(
portal
->
status
==
PORTAL_ACTIVE
)
MarkPortalFailed
(
portal
);
MarkPortalFailed
(
portal
);
...
@@ -919,9 +926,10 @@ AtSubAbort_Portals(SubTransactionId mySubid,
...
@@ -919,9 +926,10 @@ AtSubAbort_Portals(SubTransactionId mySubid,
portal
->
activeSubid
=
parentSubid
;
portal
->
activeSubid
=
parentSubid
;
/*
/*
* Upper-level portals that failed while running in this
* A MarkPortalActive() caller ran an upper-level portal in
* subtransaction must be forced into FAILED state, for the
* this subtransaction and left the portal ACTIVE. This can't
* same reasons discussed below.
* happen, but force the portal into FAILED state for the same
* reasons discussed below.
*
*
* We assume we can get away without forcing upper-level READY
* We assume we can get away without forcing upper-level READY
* portals to fail, even if they were run and then suspended.
* portals to fail, even if they were run and then suspended.
...
@@ -961,6 +969,10 @@ AtSubAbort_Portals(SubTransactionId mySubid,
...
@@ -961,6 +969,10 @@ AtSubAbort_Portals(SubTransactionId mySubid,
* We have to do this because they might refer to objects created or
* We have to do this because they might refer to objects created or
* changed in the failed subtransaction, leading to crashes within
* changed in the failed subtransaction, leading to crashes within
* ExecutorEnd when portalcmds.c tries to close down the portal.
* ExecutorEnd when portalcmds.c tries to close down the portal.
* Currently, every MarkPortalActive() caller ensures it updates the
* portal status again before relinquishing control, so ACTIVE can't
* happen here. If it does happen, dispose the portal like existing
* MarkPortalActive() callers would.
*/
*/
if
(
portal
->
status
==
PORTAL_READY
||
if
(
portal
->
status
==
PORTAL_READY
||
portal
->
status
==
PORTAL_ACTIVE
)
portal
->
status
==
PORTAL_ACTIVE
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment