Skip to content

Commit 9bf3fb8

Browse files
knizhnikkelvich
authored andcommitted
refresh cluster state in MtmReplicationStartupHook
1 parent 11ec4be commit 9bf3fb8

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

multimaster.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -2491,9 +2491,9 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId, sig_atomic_t volatile* shut
24912491
MtmSleep(STATUS_POLL_DELAY);
24922492
}
24932493
if (recovery) {
2494-
MTM_LOG1("%d: Restart replication for node %d after end of recovery", MyProcPid, nodeId);
2494+
MTM_LOG1("%d: Restart replication frim node %d after end of recovery", MyProcPid, nodeId);
24952495
} else {
2496-
MTM_LOG1("%d: Continue replication slot for node %d", MyProcPid, nodeId);
2496+
MTM_LOG1("%d: Continue replication from node %d", MyProcPid, nodeId);
24972497
}
24982498
/* After recovery completion we need to drop all other slots to avoid receive of redundant data */
24992499
return recovery ? REPLMODE_RECOVERED : REPLMODE_NORMAL;
@@ -2595,7 +2595,10 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
25952595
MtmCheckQuorum();
25962596
} else {
25972597
MtmUnlock();
2598-
elog(ERROR, "Disabled node %d tries to reconnect without recovery", MtmReplicationNodeId);
2598+
MtmRefreshClusterStatus(true);
2599+
if (BIT_CHECK(Mtm->disabledNodeMask, MtmReplicationNodeId-1)) {
2600+
elog(ERROR, "Disabled node %d tries to reconnect without recovery", MtmReplicationNodeId);
2601+
}
25992602
}
26002603
} else {
26012604
MTM_LOG1("Node %d start logical replication to node %d in normal mode", MtmNodeId, MtmReplicationNodeId);

pglogical_receiver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ pglogical_receiver_main(Datum main_arg)
612612
{
613613
ereport(LOG, (errmsg("%s: COPY Stream has abruptly ended...",
614614
worker_proc)));
615-
break;
615+
goto OnError;
616616
}
617617

618618
/* Failure when reading copy stream, leave */

t/001_basic_recovery.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
diag("polling node 2");
9090
for (my $poller = 0; $poller < 3; $poller++) {
9191
my $pollee = 2;
92-
ok($cluster->poll($poller, 'postgres', $pollee, 10, 1), "node $pollee is online according to node $poller");
92+
ok($cluster->poll($poller, 'postgres', $pollee, 1000, 1), "node $pollee is online according to node $poller");
9393
}
9494

9595
diag("getting cluster state");

0 commit comments

Comments
 (0)