Content-Length: 309276 | pFad | http://github.com/postgrespro/postgres_cluster/commit/2d68cf13b4dea29dd3e17aedd0f55364537d1cc5

61 Check for prepared transactions in MtmRollbackPreparedTransaction · postgrespro/postgres_cluster@2d68cf1 · GitHub
Skip to content

Commit 2d68cf1

Browse files
committed
Check for prepared transactions in MtmRollbackPreparedTransaction
1 parent 3df08c0 commit 2d68cf1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contrib/mmts/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
void MtmRollbackPreparedTransaction(int nodeId, char const* gid)
31083108
{
3109+
char state3pc[MAX_3PC_STATE_SIZE];
31093110
XidStatus status = MtmExchangeGlobalTransactionStatus(gid, TRANSACTION_STATUS_ABORTED);
31103111
MTM_LOG1("Abort prepared transaction %s status %s from node %d origenId=%d", gid, MtmTxnStatusMnem[status], nodeId, Mtm->nodes[nodeId-1].origenId);
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
} else if (status == TRANSACTION_STATUS_IN_PROGRESS) {
3121-
char state3pc[MAX_3PC_STATE_SIZE];
3122-
Assert(!GetPreparedTransactionState(gid, state3pc));
31233123
MtmBeginSession(nodeId);
31243124
MtmLogAbortLogicalMessage(nodeId, gid);
31253125
MtmEndSession(nodeId, true);

contrib/mmts/tests2/docker-entrypoint.sh

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

7474
cat $PGDATA/postgresql.conf

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/2d68cf13b4dea29dd3e17aedd0f55364537d1cc5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy