Skip to content

Commit 0812669

Browse files
committed
refresh cluster state in MtmReplicationStartupHook
1 parent f7c6b09 commit 0812669

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

contrib/mmts/multimaster.c

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

contrib/mmts/pglogical_receiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ pglogical_receiver_main(Datum main_arg)
611611
{
612612
ereport(LOG, (errmsg("%s: COPY Stream has abruptly ended...",
613613
worker_proc)));
614-
break;
614+
goto OnError;
615615
}
616616

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

contrib/mmts/t/001_basic_recovery.pl

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy