8000 Merge branch 'master' of github.com:postgrespro/postgres_cluster · postgrespro/postgres_cluster@fe0ec43 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe0ec43

Browse files
committed
Merge branch 'master' of github.com:postgrespro/postgres_cluster
2 parents 4f97351 + 8b327d3 commit fe0ec43

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

contrib/mmts/arbiter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ static void MtmMonitor(Datum arg)
779779
if (rc & WL_POSTMASTER_DEATH) {
780780
break;
781781
}
782-
MtmRefreshClusterStatus(true, 0);
782+
MtmRefreshClusterStatus(true);
783783
}
784784
}
785785

@@ -1086,7 +1086,7 @@ static void MtmReceiver(Datum arg)
10861086
}
10871087
if (n == 0 && Mtm->disabledNodeMask != 0) {
10881088
/* If timeout is expired and there are disabled nodes, then recheck cluster's state */
1089-
MtmRefreshClusterStatus(false, 0);
1089+
MtmRefreshClusterStatus(false);
10901090
}
10911091
}
10921092
}

contrib/mmts/multimaster.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,8 +1638,8 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
16381638
BIT_CLEAR(Mtm->nodeLockerMask, nodeId-1);
16391639
Mtm->nLockers -= 1;
16401640
} else {
1641-
MTM_LOG1("%d: node %d is caugth-up without locking cluster", MyProcPid, nodeId);
1642-
/* We are lucky: caugth-up without locking cluster! */
1641+
MTM_LOG1("%d: node %d is caught-up without locking cluster", MyProcPid, nodeId);
1642+
/* We are lucky: caught-up without locking cluster! */
16431643
}
16441644
MtmEnableNode(nodeId);
16451645
Mtm->nConfigChanges += 1;
@@ -1789,9 +1789,9 @@ MtmBuildConnectivityMatrix(nodemask_t* matrix, bool nowait)
17891789
* Build connectivity graph, find clique in it and extend disabledNodeMask by nodes not included in clique.
17901790
* This function returns false if current node is excluded from cluster, true otherwise
17911791
*/
1792-
bool MtmRefreshClusterStatus(bool nowait, int testNodeId)
1792+
bool MtmRefreshClusterStatus(bool nowait)
17931793
{
1794-
nodemask_t mask, clique, disabled, enabled;
1794+
nodemask_t mask, clique, disabled;
17951795
nodemask_t matrix[MAX_NODES];
17961796
int clique_size;
17971797
int i;
@@ -1832,13 +1832,6 @@ bool MtmRefreshClusterStatus(bool nowait, int testNodeId)
18321832
}
18331833
}
18341834
}
1835-
}
1836-
enabled = clique & Mtm->disabledNodeMask; /* new enabled nodes mask */
1837-
if (testNodeId != 0 && BIT_CHECK(enabled, testNodeId-1)) {
1838-
MtmEnableNode(testNodeId);
1839-
}
1840-
1841-
if (disabled|enabled) {
18421835
MtmCheckQuorum();
18431836
}
18441837
#if 0
@@ -1918,7 +1911,7 @@ void MtmOnNodeDisconnect(int nodeId)
19181911
}
19191912

19201913
MtmSleep(MSEC_TO_USEC(MtmHeartbeatSendTimeout));
1921-
MtmRefreshClusterStatus(false, 0);
1914+
MtmRefreshClusterStatus(false);
19221915
}
19231916

19241917
void MtmOnNodeConnect(int nodeId)
@@ -3087,12 +3080,7 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
30873080
MtmCheckQuorum();
30883081
} else {
30893082
MtmUnlock();
3090-
MtmRefreshClusterStatus(true, MtmReplicationNodeId);
3091-
MtmLock(LW_SHARED);
3092-
if (BIT_CHECK(Mtm->disabledNodeMask, MtmReplicationNodeId-1)) {
3093-
MtmUnlock();
3094-
elog(ERROR, "Disabled node %d tries to reconnect without recovery", MtmReplicationNodeId);
3095-
}
3083+
elog(ERROR, "Disabled node %d tries to reconnect without recovery", MtmReplicationNodeId);
30963084
}
30973085
} else {
30983086
MTM_LOG1("Node %d start logical replication to node %d in normal mode", MtmNodeId, MtmReplicationNodeId);

contrib/mmts/multimaster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ extern TransactionId MtmGetCurrentTransactionId(void);
350350
extern XidStatus MtmGetCurrentTransactionStatus(void);
351351
extern XidStatus MtmExchangeGlobalTransactionStatus(char const* gid, XidStatus status);
352352
extern bool MtmIsRecoveredNode(int nodeId);
353-
extern bool MtmRefreshClusterStatus(bool nowait, int testNodeId);
353+
extern bool MtmRefreshClusterStatus(bool nowait);
354354
extern void MtmSwitchClusterMode(MtmNodeStatus mode);
355355
extern void MtmUpdateNodeConnectionInfo(MtmConnectionInfo* conn, char const* connStr);
356356
extern void MtmSetupReplicationHooks(struct PGLogicalHooks* hooks);

0 commit comments

Comments
 (0)
0