@@ -1773,6 +1773,10 @@ void MtmRecoveryCompleted(void)
1773
1773
MTM_LOG1 ("Recovery of node %d is completed, disabled mask=%llx, connectivity mask=%llx, endLSN=%lx, live nodes=%d" ,
1774
1774
MtmNodeId , (long long ) Mtm -> disabledNodeMask ,
1775
1775
(long long )SELF_CONNECTIVITY_MASK , GetXLogInsertRecPtr (), Mtm -> nLiveNodes );
1776
+ if (Mtm -> nAllNodes >= 3 ) {
1777
+ elog (WARNING , "restartLSNs at the end of recovery: {%lx, %lx, %lx}" ,
1778
+ Mtm -> nodes [0 ].restartLSN , Mtm -> nodes [1 ].restartLSN , Mtm -> nodes [2 ].restartLSN );
1779
+ }
1776
1780
MtmLock (LW_EXCLUSIVE );
1777
1781
Mtm -> recoverySlot = 0 ;
1778
1782
Mtm -> recoveredLSN = GetXLogInsertRecPtr ();
@@ -3244,7 +3248,12 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId, sig_atomic_t volatile* shut
3244
3248
|| Mtm -> recoverySlot == nodeId )
3245
3249
{
3246
3250
/* Choose for recovery first available slot or slot of donor node (if any) */
3247
- elog (WARNING , "Process %d starts recovery from node %d" , MyProcPid , nodeId );
3251
+ if (Mtm -> nAllNodes >= 3 ) {
3252
+ elog (WARNING , "Process %d starts recovery from node %d restartLSNs={%lx, %lx, %lx}" ,
3253
+ MyProcPid , nodeId , Mtm -> nodes [0 ].restartLSN , Mtm -> nodes [1 ].restartLSN , Mtm -> nodes [2 ].restartLSN );
3254
+ } else {
3255
+ elog (WARNING , "Process %d starts recovery from node %d" , MyProcPid , nodeId );
3256
+ }
3248
3257
Mtm -> recoverySlot = nodeId ;
3249
3258
Mtm -> nReceivers = 0 ;
3250
3259
Mtm -> nSenders = 0 ;
@@ -3383,7 +3392,7 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
3383
3392
sscanf (strVal (elem -> arg ), "%lx" , & recoveredLSN );
3384
3393
MTM_LOG1 ("Recovered position of node %d is %lx" , MtmReplicationNodeId , recoveredLSN );
3385
3394
if (Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN < recoveredLSN ) {
3386
- MTM_LOG2 ( "[restartlsn] node %d: %lx -> %lx (MtmReplicationStartupHook)" , MtmReplicationNodeId , Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN , recoveredLSN );
3395
+ MTM_LOG1 ( "Advance restartLSN for node %d from %lx to %lx (MtmReplicationStartupHook)" , MtmReplicationNodeId , Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN , recoveredLSN );
3387
3396
Assert (Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN == InvalidXLogRecPtr
3388
3397
|| recoveredLSN < Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN + MtmMaxRecoveryLag );
3389
3398
Mtm -> nodes [MtmReplicationNodeId - 1 ].restartLSN = recoveredLSN ;
@@ -3587,9 +3596,13 @@ bool MtmFilterTransaction(char* record, int size)
3587
3596
origin_node = pq_getmsgbyte (& s );
3588
3597
origin_lsn = pq_getmsgint64 (& s );
3589
3598
3590
- Assert (replication_node == MtmReplicationNodeId &&
3591
- origin_node != 0 &&
3592
- (Mtm -> status == MTM_RECOVERY || origin_node == replication_node ));
3599
+ Assert (replication_node == MtmReplicationNodeId );
3600
+ if (!(origin_node != 0 &&
3601
+ (Mtm -> status == MTM_RECOVERY || origin_node == replication_node )))
3602
+ {
3603
+ elog (WARNING , "Receive redirected commit event %d from node %d origin node %d origin LSN %lx in %s mode" ,
3604
+ event , replication_node , origin_node , origin_lsn , MtmNodeStatusMnem [Mtm -> status ]);
3605
+ }
3593
3606
3594
3607
switch (event )
3595
3608
{
@@ -3616,8 +3629,8 @@ bool MtmFilterTransaction(char* record, int size)
3616
3629
}
3617
3630
3618
3631
if (duplicate ) {
3619
- MTM_LOG1 ("Ignore transaction %s from node %d event=%x because our LSN position %lx for origin node %d is greater or equal than LSN %lx of this transaction (end_lsn=%lx, origin_lsn=%lx)" ,
3620
- gid , replication_node , event , Mtm -> nodes [origin_node - 1 ].restartLSN , origin_node , restart_lsn , end_lsn , origin_lsn );
3632
+ MTM_LOG1 ("Ignore transaction %s from node %d event=%x because our LSN position %lx for origin node %d is greater or equal than LSN %lx of this transaction (end_lsn=%lx, origin_lsn=%lx) mode %s " ,
3633
+ gid , replication_node , event , Mtm -> nodes [origin_node - 1 ].restartLSN , origin_node , restart_lsn , end_lsn , origin_lsn , MtmNodeStatusMnem [ Mtm -> status ] );
3621
3634
} else {
3622
3635
MTM_LOG2 ("Apply transaction %s from node %d lsn %lx, event=%x, origin node %d, original lsn=%lx, current lsn=%lx" ,
3623
3636
gid , replication_node , end_lsn , event , origin_node , origin_lsn , restart_lsn );
0 commit comments