@@ -213,10 +213,10 @@ static char const* const MtmReplicationModeName[] =
213
213
};
214
214
215
215
static void
216
- MtmExecute (void * work , int size , MtmReplicationMode mode )
216
+ MtmExecute (void * work , int size )
217
217
{
218
218
/* During recovery apply changes sequentially to preserve commit order */
219
- if (mode == REPLMODE_RECOVERY || mode == REPLMODE_RECOVERED )
219
+ if (Mtm -> status == MTM_RECOVERY )
220
220
MtmExecutor (work , size );
221
221
else
222
222
BgwPoolExecute (& Mtm -> nodes [MtmReplicationNodeId - 1 ].pool , work , size );
@@ -309,8 +309,6 @@ pglogical_receiver_main(Datum main_arg)
309
309
lsn_t originStartPos ;
310
310
int timeline ;
311
311
312
- ByteBufferReset (& buf );
313
-
314
312
/*
315
313
* Determine when and how we should open replication slot.
316
314
* Druing recovery we need to open only one replication slot from which node should receive all transactions.
@@ -583,7 +581,7 @@ pglogical_receiver_main(Datum main_arg)
583
581
if (stmt [0 ] == 'Z' || (stmt [0 ] == 'M' && (stmt [1 ] == 'L' || stmt [1 ] == 'A' || stmt [1 ] == 'C' ))) {
584
582
MTM_LOG3 ("Process '%c' message from %d" , stmt [1 ], nodeId );
585
583
if (stmt [0 ] == 'M' && stmt [1 ] == 'C' ) { /* concurrent DDL should be executed by parallel workers */
586
- MtmExecute (stmt , msg_len , mode );
584
+ MtmExecute (stmt , msg_len );
587
585
} else {
588
586
MtmExecutor (stmt , msg_len ); /* all other messages can be processed by receiver itself */
589
587
}
@@ -599,7 +597,7 @@ pglogical_receiver_main(Datum main_arg)
599
597
pq_sendint (& spill_info , buf .used , 4 );
600
598
MtmSpillToFile (spill_file , buf .data , buf .used );
601
599
MtmCloseSpillFile (spill_file );
602
- MtmExecute (spill_info .data , spill_info .len , mode );
600
+ MtmExecute (spill_info .data , spill_info .len );
603
601
spill_file = -1 ;
604
602
resetStringInfo (& spill_info );
605
603
} else {
@@ -614,7 +612,7 @@ pglogical_receiver_main(Datum main_arg)
614
612
} else {
615
613
/* all other commits should be applied in place */
616
614
// Assert(stmt[1] == PGLOGICAL_PREPARE || stmt[1] == PGLOGICAL_COMMIT || stmt[1] == PGLOGICAL_PRECOMMIT_PREPARED);
617
- MtmExecute (buf .data , buf .used , mode );
615
+ MtmExecute (buf .data , buf .used );
618
616
}
619
617
}
620
618
} else if (spill_file >= 0 ) {
0 commit comments