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

Commit147075c

Browse files
knizhnikkelvich
authored andcommitted
Check for prepared transactions in MtmRollbackPreparedTransaction
1 parent0df255b commit147075c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎multimaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,9 +3106,11 @@ void MtmReleaseRecoverySlot(int nodeId)
31063106
*/
31073107
voidMtmRollbackPreparedTransaction(intnodeId,charconst*gid)
31083108
{
3109+
charstate3pc[MAX_3PC_STATE_SIZE];
31093110
XidStatusstatus=MtmExchangeGlobalTransactionStatus(gid,TRANSACTION_STATUS_ABORTED);
31103111
MTM_LOG1("Abort prepared transaction %s status %s from node %d originId=%d",gid,MtmTxnStatusMnem[status],nodeId,Mtm->nodes[nodeId-1].originId);
3111-
if (status==TRANSACTION_STATUS_UNKNOWN) {
3112+
if (status==TRANSACTION_STATUS_UNKNOWN|| (status==TRANSACTION_STATUS_IN_PROGRESS&&GetPreparedTransactionState(gid,state3pc)))
3113+
{
31123114
MTM_LOG1("PGLOGICAL_ABORT_PREPARED commit: gid=%s #2",gid);
31133115
MtmResetTransaction();
31143116
StartTransactionCommand();
@@ -3118,8 +3120,6 @@ void MtmRollbackPreparedTransaction(int nodeId, char const* gid)
31183120
CommitTransactionCommand();
31193121
MtmEndSession(nodeId, true);
31203122
}elseif (status==TRANSACTION_STATUS_IN_PROGRESS) {
3121-
charstate3pc[MAX_3PC_STATE_SIZE];
3122-
Assert(!GetPreparedTransactionState(gid,state3pc));
31233123
MtmBeginSession(nodeId);
31243124
MtmLogAbortLogicalMessage(nodeId,gid);
31253125
MtmEndSession(nodeId, true);

‎tests2/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [ "$1" = 'postgres' ]; then
6969
multimaster.conn_strings = '$CONNSTRS'
7070
multimaster.heartbeat_recv_timeout = 1100
7171
multimaster.heartbeat_send_timeout = 250
72-
multimaster.min_2pc_timeout =2000
72+
multimaster.min_2pc_timeout =100000
7373
EOF
7474

7575
cat$PGDATA/postgresql.conf

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp