Skip to content

Commit ae868c9

Browse files
knizhnikkelvich
authored andcommitted
Fix mtm_poll_node function
1 parent 4ecb7b5 commit ae868c9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

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

multimaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2619,7 +2619,7 @@ mtm_poll_node(PG_FUNCTION_ARGS)
26192619
bool nowait = PG_GETARG_BOOL(1);
26202620
bool online = true;
26212621
while ((nodeId == MtmNodeId && Mtm->status != MTM_ONLINE)
2622-
|| (nodeId =! MtmNodeId && BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)))
2622+
|| (nodeId != MtmNodeId && BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)))
26232623
{
26242624
if (nowait) {
26252625
online = false;

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