Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
cd0cebaf
Commit
cd0cebaf
authored
Apr 06, 2017
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always SnapshotResetXmin() during ClearTransaction()
Avoid corner cases during 2PC with
6bad580d
parent
32173270
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
src/backend/access/transam/xact.c
src/backend/access/transam/xact.c
+1
-1
src/backend/utils/time/snapmgr.c
src/backend/utils/time/snapmgr.c
+7
-8
src/include/utils/snapmgr.h
src/include/utils/snapmgr.h
+1
-1
No files found.
src/backend/access/transam/xact.c
View file @
cd0cebaf
...
...
@@ -2640,7 +2640,7 @@ CleanupTransaction(void)
* do abort cleanup processing
*/
AtCleanup_Portals
();
/* now safe to release portal memory */
AtEOXact_Snapshot
(
false
,
fals
e
);
/* and release the transaction's snapshots */
AtEOXact_Snapshot
(
false
,
tru
e
);
/* and release the transaction's snapshots */
CurrentResourceOwner
=
NULL
;
/* and resource owner */
if
(
TopTransactionResourceOwner
)
...
...
src/backend/utils/time/snapmgr.c
View file @
cd0cebaf
...
...
@@ -1051,7 +1051,7 @@ AtSubAbort_Snapshot(int level)
* Snapshot manager's cleanup function for end of transaction
*/
void
AtEOXact_Snapshot
(
bool
isCommit
,
bool
isPrepare
)
AtEOXact_Snapshot
(
bool
isCommit
,
bool
resetXmin
)
{
/*
* In transaction-snapshot mode we must release our privately-managed
...
...
@@ -1137,16 +1137,15 @@ AtEOXact_Snapshot(bool isCommit, bool isPrepare)
FirstSnapshotSet
=
false
;
/*
* During normal commit and abort processing, we call
* ProcArrayEndTransaction() or ProcArrayClearTransaction() to
* reset the PgXact->xmin. That call happens prior to the call to
* AtEOXact_Snapshot(), so we need not touch xmin here at all,
* accept when we are preparing a transaction.
* During normal commit processing, we call
* ProcArrayEndTransaction() to reset the PgXact->xmin. That call
* happens prior to the call to AtEOXact_Snapshot(), so we need
* not touch xmin here at all.
*/
if
(
isPrepare
)
if
(
resetXmin
)
SnapshotResetXmin
();
Assert
(
isPrepare
||
MyPgXact
->
xmin
==
0
);
Assert
(
resetXmin
||
MyPgXact
->
xmin
==
0
);
}
...
...
src/include/utils/snapmgr.h
View file @
cd0cebaf
...
...
@@ -85,7 +85,7 @@ extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner);
extern
void
AtSubCommit_Snapshot
(
int
level
);
extern
void
AtSubAbort_Snapshot
(
int
level
);
extern
void
AtEOXact_Snapshot
(
bool
isCommit
,
bool
isPrepare
);
extern
void
AtEOXact_Snapshot
(
bool
isCommit
,
bool
resetXmin
);
extern
void
ImportSnapshot
(
const
char
*
idstr
);
extern
bool
XactHasExportedSnapshots
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment