Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d83cf8f

Browse files
committed
Add pooling of all nodes
1 parent 0479f78 commit d83cf8f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

contrib/mmts/multimaster.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,9 @@ mtm_poll_node(PG_FUNCTION_ARGS)
22682268
int nodeId = PG_GETARG_INT32(0);
22692269
bool nowait = PG_GETARG_BOOL(1);
22702270
bool online = true;
2271-
while (BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)) {
2271+
while ((nodeId == MtmNodeId && Mtm->status != MTM_ONLINE)
2272+
|| (nodeId =! MtmNodeId && BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)))
2273+
{
22722274
if (nowait) {
22732275
online = false;
22742276
break;

contrib/mmts/t/001_basic_recovery.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
$cluster->psql(0, 'postgres', "select mtm.poll_node(3);");
6666
$cluster->psql(1, 'postgres', "select mtm.poll_node(3);");
67+
$cluster->psql(2, 'postgres', "select mtm.poll_node(3);");
6768
diag("inserting 3");
6869

6970
$cluster->psql(0, 'postgres', "insert into t values(3, 30);");

0 commit comments

Comments
 (0)