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

Commit c144b05

Browse files
knizhnikkelvich
authored andcommitted
Add pooling of all nodes
1 parent 2e82abe commit c144b05

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

multimaster.c

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

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)