@@ -133,7 +133,7 @@ static void MtmBeginTransaction(MtmCurrentTrans* x);
133
133
static void MtmPrePrepareTransaction (MtmCurrentTrans * x );
134
134
static void MtmPostPrepareTransaction (MtmCurrentTrans * x );
135
135
static void MtmAbortPreparedTransaction (MtmCurrentTrans * x );
136
- static void MtmCommitPreparedTransaction (MtmCurrentTrans * x );
136
+ static void MtmPreCommitPreparedTransaction (MtmCurrentTrans * x );
137
137
static void MtmEndTransaction (MtmCurrentTrans * x , bool commit );
138
138
static bool MtmTwoPhaseCommit (MtmCurrentTrans * x );
139
139
static TransactionId MtmGetOldestXmin (Relation rel , bool ignoreVacuum );
@@ -705,8 +705,8 @@ MtmXactCallback(XactEvent event, void *arg)
705
705
case XACT_EVENT_ABORT_PREPARED :
706
706
MtmAbortPreparedTransaction (& MtmTx );
707
707
break ;
708
- case XACT_EVENT_COMMIT_PREPARED :
709
- MtmCommitPreparedTransaction (& MtmTx );
708
+ case XACT_EVENT_PRE_COMMIT_PREPARED :
709
+ MtmPreCommitPreparedTransaction (& MtmTx );
710
710
break ;
711
711
case XACT_EVENT_COMMIT :
712
712
MtmEndTransaction (& MtmTx , true);
@@ -1149,7 +1149,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
1149
1149
}
1150
1150
1151
1151
static void
1152
- MtmCommitPreparedTransaction (MtmCurrentTrans * x )
1152
+ MtmPreCommitPreparedTransaction (MtmCurrentTrans * x )
1153
1153
{
1154
1154
MtmTransMap * tm ;
1155
1155
MtmTransState * ts ;
@@ -1181,6 +1181,7 @@ MtmCommitPreparedTransaction(MtmCurrentTrans* x)
1181
1181
Mtm2PCVoting (x , ts );
1182
1182
1183
1183
x -> xid = ts -> xid ;
1184
+ x -> csn = ts -> csn ;
1184
1185
x -> isPrepared = true;
1185
1186
}
1186
1187
MtmUnlock ();
@@ -3529,6 +3530,7 @@ bool MtmFilterTransaction(char* record, int size)
3529
3530
}
3530
3531
restart_lsn = origin_node == MtmReplicationNodeId ? end_lsn : origin_lsn ;
3531
3532
if (Mtm -> nodes [origin_node - 1 ].restartLSN < restart_lsn ) {
3533
+ Assert (restart_lsn != InvalidXLogRecPtr );
3532
3534
MTM_LOG2 ("[restartlsn] node %d: %lx -> %lx (MtmFilterTransaction)" , MtmReplicationNodeId , Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN , restart_lsn );
3533
3535
Mtm -> nodes [origin_node - 1 ].restartLSN = restart_lsn ;
3534
3536
} else {
@@ -4442,19 +4444,14 @@ static void MtmProcessDDLCommand(char const* queryString, bool transactional)
4442
4444
}
4443
4445
MTM_LOG3 ("Sending utility: %s" , queryString );
4444
4446
if (transactional ) {
4445
- /* DDL */
4447
+ /* Transactional DDL */
4446
4448
LogLogicalMessage ("D" , queryString , strlen (queryString ) + 1 , true);
4447
4449
MtmTx .containsDML = true;
4448
- } else {
4449
- char * gucCtx = MtmGucSerialize ();
4450
- return ;
4451
- if (* gucCtx ) {
4452
- queryString = psprintf ("%s; %s" , gucCtx , queryString );
4453
- }
4454
- /* CONCURRENT DDL */
4450
+ } else {
4451
+ MTM_LOG1 ("Execute concurrent DDL: %s" , queryString );
4452
+ /* Concurrent DDL */
4455
4453
XLogFlush (LogLogicalMessage ("C" , queryString , strlen (queryString ) + 1 , false));
4456
4454
}
4457
- return ;
4458
4455
}
4459
4456
4460
4457
static void MtmFinishDDLCommand ()
@@ -4542,7 +4539,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
4542
4539
4543
4540
case T_VacuumStmt :
4544
4541
skipCommand = true;
4545
- #if 0
4546
4542
if (context == PROCESS_UTILITY_TOPLEVEL ) {
4547
4543
MtmProcessDDLCommand (queryString , false);
4548
4544
MtmTx .isDistributed = false;
@@ -4553,7 +4549,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
4553
4549
MemoryContextSwitchTo (oldContext );
4554
4550
return ;
4555
4551
}
4556
- #endif
4557
4552
break ;
4558
4553
4559
4554
case T_CreateDomainStmt :
0 commit comments