Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8f9be26

Browse files
committed
Add HOLD_INTERRUPTS section into FinishPreparedTransaction.
If an interrupt arrives in the middle of FinishPreparedTransactionand any callback decide to call CHECK_FOR_INTERRUPTS (e.g.RemoveTwoPhaseFile can write a warning with ereport, which checks forinterrupts) then it's possible to leave current GXact undeleted.Backpatch to all supported branchesStas KelvichDiscussion: ihttps://www.postgresql.org/message-id/3AD85097-A3F3-4EBA-99BD-C38EDF8D2949@postgrespro.ru
1 parentcddc4dc commit8f9be26

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/backend/access/transam/twophase.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,9 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
14871487
/* compute latestXid among all children */
14881488
latestXid=TransactionIdLatest(xid,hdr->nsubxacts,children);
14891489

1490+
/* Prevent cancel/die interrupt while cleaning up */
1491+
HOLD_INTERRUPTS();
1492+
14901493
/*
14911494
* The order of operations here is critical: make the XLOG entry for
14921495
* commit or abort, then mark the transaction committed or aborted in
@@ -1578,6 +1581,8 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
15781581
LWLockRelease(TwoPhaseStateLock);
15791582
MyLockedGxact=NULL;
15801583

1584+
RESUME_INTERRUPTS();
1585+
15811586
pfree(buf);
15821587
}
15831588

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp