File tree 3 files changed +13
-0
lines changed
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ typedef struct MtmDecoderPrivate
48
48
bool is_recovery ;
49
49
bool recovery_done ;
50
50
int recovery_count ;
51
+ int counterpart_disable_count ;
51
52
int64 session_id ;
52
53
MtmConfig * cfg ;
53
54
} MtmDecoderPrivate ;
Original file line number Diff line number Diff line change @@ -478,6 +478,17 @@ pg_decode_caughtup(LogicalDecodingContext *ctx)
478
478
abort (); /* keep the compiler quiet */
479
479
}
480
480
481
+
482
+ if (hooks_data -> counterpart_disable_count != MtmGetNodeDisableCount (MtmReplicationNodeId ))
483
+ {
484
+ mtm_log (LOG , "exiting due to disabled counterpart" );
485
+ if (whereToSendOutput == DestRemote )
486
+ whereToSendOutput = DestNone ;
487
+
488
+ proc_exit (0 );
489
+ abort (); /* keep the compiler quiet */
490
+ }
491
+
481
492
/*
482
493
* MtmOutputPluginPrepareWrite send some bytes to downstream,
483
494
* so we must avoid calling it in normal (non-recovery) situation.
Original file line number Diff line number Diff line change @@ -722,6 +722,7 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
722
722
hooks_data -> is_recovery = false;
723
723
hooks_data -> cfg = MtmLoadConfig ();
724
724
hooks_data -> recovery_count = MtmGetRecoveryCount ();
725
+ hooks_data -> counterpart_disable_count = MtmGetNodeDisableCount (MtmReplicationNodeId );
725
726
726
727
foreach (param , args -> in_params )
727
728
{
You can’t perform that action at this time.
0 commit comments