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
9cf4eaa0
Commit
9cf4eaa0
authored
Aug 30, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failure to advance nextXID beyond subtransactions whose XIDs appear
only within COMMIT or ABORT records.
parent
af8406bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
6 deletions
+42
-6
src/backend/access/transam/xact.c
src/backend/access/transam/xact.c
+42
-6
No files found.
src/backend/access/transam/xact.c
View file @
9cf4eaa0
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.18
4 2004/08/30 02:54:38 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.18
5 2004/08/30 19:00:03 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -3462,12 +3462,30 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
...
@@ -3462,12 +3462,30 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
if
(
info
==
XLOG_XACT_COMMIT
)
if
(
info
==
XLOG_XACT_COMMIT
)
{
{
xl_xact_commit
*
xlrec
=
(
xl_xact_commit
*
)
XLogRecGetData
(
record
);
xl_xact_commit
*
xlrec
=
(
xl_xact_commit
*
)
XLogRecGetData
(
record
);
TransactionId
*
sub_xids
;
TransactionId
max_xid
;
int
i
;
int
i
;
TransactionIdCommit
(
record
->
xl_xid
);
TransactionIdCommit
(
record
->
xl_xid
);
/* Mark committed subtransactions as committed */
/* Mark committed subtransactions as committed */
TransactionIdCommitTree
(
xlrec
->
nsubxacts
,
sub_xids
=
(
TransactionId
*
)
&
(
xlrec
->
xnodes
[
xlrec
->
nrels
]);
(
TransactionId
*
)
&
(
xlrec
->
xnodes
[
xlrec
->
nrels
]));
TransactionIdCommitTree
(
xlrec
->
nsubxacts
,
sub_xids
);
/* Make sure nextXid is beyond any XID mentioned in the record */
max_xid
=
record
->
xl_xid
;
for
(
i
=
0
;
i
<
xlrec
->
nsubxacts
;
i
++
)
{
if
(
TransactionIdPrecedes
(
max_xid
,
sub_xids
[
i
]))
max_xid
=
sub_xids
[
i
];
}
if
(
TransactionIdFollowsOrEquals
(
max_xid
,
ShmemVariableCache
->
nextXid
))
{
ShmemVariableCache
->
nextXid
=
max_xid
;
TransactionIdAdvance
(
ShmemVariableCache
->
nextXid
);
}
/* Make sure files supposed to be dropped are dropped */
/* Make sure files supposed to be dropped are dropped */
for
(
i
=
0
;
i
<
xlrec
->
nrels
;
i
++
)
for
(
i
=
0
;
i
<
xlrec
->
nrels
;
i
++
)
{
{
...
@@ -3478,12 +3496,30 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
...
@@ -3478,12 +3496,30 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
else
if
(
info
==
XLOG_XACT_ABORT
)
else
if
(
info
==
XLOG_XACT_ABORT
)
{
{
xl_xact_abort
*
xlrec
=
(
xl_xact_abort
*
)
XLogRecGetData
(
record
);
xl_xact_abort
*
xlrec
=
(
xl_xact_abort
*
)
XLogRecGetData
(
record
);
TransactionId
*
sub_xids
;
TransactionId
max_xid
;
int
i
;
int
i
;
TransactionIdAbort
(
record
->
xl_xid
);
TransactionIdAbort
(
record
->
xl_xid
);
/* mark subtransactions as aborted */
TransactionIdAbortTree
(
xlrec
->
nsubxacts
,
/* Mark subtransactions as aborted */
(
TransactionId
*
)
&
(
xlrec
->
xnodes
[
xlrec
->
nrels
]));
sub_xids
=
(
TransactionId
*
)
&
(
xlrec
->
xnodes
[
xlrec
->
nrels
]);
TransactionIdAbortTree
(
xlrec
->
nsubxacts
,
sub_xids
);
/* Make sure nextXid is beyond any XID mentioned in the record */
max_xid
=
record
->
xl_xid
;
for
(
i
=
0
;
i
<
xlrec
->
nsubxacts
;
i
++
)
{
if
(
TransactionIdPrecedes
(
max_xid
,
sub_xids
[
i
]))
max_xid
=
sub_xids
[
i
];
}
if
(
TransactionIdFollowsOrEquals
(
max_xid
,
ShmemVariableCache
->
nextXid
))
{
ShmemVariableCache
->
nextXid
=
max_xid
;
TransactionIdAdvance
(
ShmemVariableCache
->
nextXid
);
}
/* Make sure files supposed to be dropped are dropped */
/* Make sure files supposed to be dropped are dropped */
for
(
i
=
0
;
i
<
xlrec
->
nrels
;
i
++
)
for
(
i
=
0
;
i
<
xlrec
->
nrels
;
i
++
)
{
{
...
...
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