8000 Rollback all prepared transaction · m99coder/postgres_cluster@a961955 · GitHub
[go: up one dir, main page]

Skip to content

Commit a961955

Browse files
committed
Rollback all prepared transaction
1 parent 516a531 commit a961955

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

contrib/mmts/arbiter.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ static int MtmConnectSocket(int node, int port, int timeout)
473473
if (BIT_CHECK(resp.disabledNodeMask, MtmNodeId-1)) {
474474
elog(WARNING, "Node %d thinks that I was dead", resp.node);
475475
BIT_SET(Mtm->disabledNodeMask, MtmNodeId-1);
476+
MtmRollbackAllPreparedTransactions();
476477
MtmSwitchClusterMode(MTM_RECOVERY);
477478
}
478479
MtmUnlock();

contrib/mmts/multimaster.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,11 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
10441044
}
10451045
}
10461046

1047+
void MtmRollbackAllPreparedTransactions(void)
1048+
{
1049+
}
1050+
1051+
10471052
void MtmSetCurrentTransactionGID(char const* gid)
10481053
{
10491054
MTM_LOG3("Set current transaction xid=%d GID %s", MtmTx.xid 7E4A , gid);

contrib/mmts/multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ extern void MtmUpdateLsnMapping(int nodeId, XLogRecPtr endLsn);
281281
extern XLogRecPtr MtmGetFlushPosition(int nodeId);
282282
extern void MtmWatchdog(void);
283283
extern void MtmCheckHeartbeat(void);
284+
extern void MtmRollbackAllPreparedTransactions(void);
284285

285286

286287

0 commit comments

Comments
 (0)
0