Skip to content

Commit 85f5e94

Browse files
committed
Fix mtm_poll_node function
1 parent a9b29dc commit 85f5e94

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

contrib/mmts/Cluster.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ sub configure
101101
multimaster.node_id = $id
102102
multimaster.conn_strings = '$connstr'
103103
multimaster.use_raftable = true
104+
multimaster.heartbeat_recv_timeout = 1000
105+
multimaster.heartbeat_send_timeout = 250
104106
multimaster.ignore_tables_without_pk = true
105107
multimaster.twopc_min_timeout = 2000
106108
raftable.id = $id

contrib/mmts/multimaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ mtm_poll_node(PG_FUNCTION_ARGS)
26102610
bool nowait = PG_GETARG_BOOL(1);
26112611
bool online = true;
26122612
while ((nodeId == MtmNodeId && Mtm->status != MTM_ONLINE)
2613-
|| (nodeId =! MtmNodeId && BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)))
2613+
|| (nodeId != MtmNodeId && BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)))
26142614
{
26152615
if (nowait) {
26162616
online = false;

contrib/mmts/t/001_basic_recovery.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@
7171
diag("starting node 2");
7272
$cluster->{nodes}->[2]->start;
7373

74-
$cluster->psql(0, 'postgres', "select mtm.poll_node(3);");
75-
7674
diag("inserting 6 on node 1 (can fail)");
7775
$cluster->psql(0, 'postgres', "insert into t values(6, 60);");
7876
diag("inserting 7 on node 2 (can fail)");
7977
$cluster->psql(1, 'postgres', "insert into t values(7, 70);");
8078

81-
sleep(5); # Wait until recovery of node will be completed
79+
$cluster->psql(0, 'postgres', "select mtm.poll_node(3);");
80+
$cluster->psql(1, 'postgres', "select mtm.poll_node(3);");
81+
$cluster->psql(2, 'postgres', "select mtm.poll_node(3);");
8282

8383
$cluster->psql(0, 'postgres', "select * from mtm.get_cluster_state();", stdout => \$psql_out);
8484
diag("Node 1 status: $psql_out");

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