Skip to content

Commit 6a3bf9b

Browse files
committed
hooks for tsdtm in twophase.c
1 parent 7b3b260 commit 6a3bf9b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/backend/access/transam/twophase.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,15 +1381,21 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
13811381
* callbacks will release the locks the transaction held.
13821382
*/
13831383
if (isCommit)
1384+
{
13841385
RecordTransactionCommitPrepared(xid,
13851386
hdr->nsubxacts, children,
13861387
hdr->ncommitrels, commitrels,
13871388
hdr->ninvalmsgs, invalmsgs,
13881389
hdr->initfileinval);
1390+
CallXactCallbacks(XACT_EVENT_COMMIT_PREPARED);
1391+
}
13891392
else
1393+
{
13901394
RecordTransactionAbortPrepared(xid,
13911395
hdr->nsubxacts, children,
13921396
hdr->nabortrels, abortrels);
1397+
CallXactCallbacks(XACT_EVENT_ABORT_PREPARED);
1398+
}
13931399

13941400
ProcArrayRemove(proc, latestXid);
13951401

@@ -2150,3 +2156,12 @@ RecordTransactionAbortPrepared(TransactionId xid,
21502156
*/
21512157
SyncRepWaitForLSN(recptr);
21522158
}
2159+
2160+
/*
2161+
* Return identified of current global transaction
2162+
*/
2163+
const char*
2164+
GetLockedGlobalTransactionId(void)
2165+
{
2166+
return MyLockedGxact ? MyLockedGxact->gid : NULL;
2167+
}

0 commit comments

Comments
 (0)