Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commiteb8f5b2

Browse files
knizhnikkelvich
authored andcommitted
Do not enable node without recovery
1 parentc8b01ea commiteb8f5b2

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

‎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
}

‎multimaster.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,8 +1628,8 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
16281628
BIT_CLEAR(Mtm->nodeLockerMask,nodeId-1);
16291629
Mtm->nLockers-=1;
16301630
}else {
1631-
MTM_LOG1("%d: node %d iscaugth-up without locking cluster",MyProcPid,nodeId);
1632-
/* We are lucky:caugth-up without locking cluster! */
1631+
MTM_LOG1("%d: node %d iscaught-up without locking cluster",MyProcPid,nodeId);
1632+
/* We are lucky:caught-up without locking cluster! */
16331633
}
16341634
MtmEnableNode(nodeId);
16351635
Mtm->nConfigChanges+=1;
@@ -1779,9 +1779,9 @@ MtmBuildConnectivityMatrix(nodemask_t* matrix, bool nowait)
17791779
* Build connectivity graph, find clique in it and extend disabledNodeMask by nodes not included in clique.
17801780
* This function returns false if current node is excluded from cluster, true otherwise
17811781
*/
1782-
boolMtmRefreshClusterStatus(boolnowait,inttestNodeId)
1782+
boolMtmRefreshClusterStatus(boolnowait)
17831783
{
1784-
nodemask_tmask,clique,disabled,enabled;
1784+
nodemask_tmask,clique,disabled;
17851785
nodemask_tmatrix[MAX_NODES];
17861786
intclique_size;
17871787
inti;
@@ -1822,13 +1822,6 @@ bool MtmRefreshClusterStatus(bool nowait, int testNodeId)
18221822
}
18231823
}
18241824
}
1825-
}
1826-
enabled=clique&Mtm->disabledNodeMask;/* new enabled nodes mask */
1827-
if (testNodeId!=0&&BIT_CHECK(enabled,testNodeId-1)) {
1828-
MtmEnableNode(testNodeId);
1829-
}
1830-
1831-
if (disabled|enabled) {
18321825
MtmCheckQuorum();
18331826
}
18341827
#if0
@@ -1908,7 +1901,7 @@ void MtmOnNodeDisconnect(int nodeId)
19081901
}
19091902

19101903
MtmSleep(MSEC_TO_USEC(MtmHeartbeatSendTimeout));
1911-
MtmRefreshClusterStatus(false,0);
1904+
MtmRefreshClusterStatus(false);
19121905
}
19131906

19141907
voidMtmOnNodeConnect(intnodeId)
@@ -3077,12 +3070,7 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
30773070
MtmCheckQuorum();
30783071
}else {
30793072
MtmUnlock();
3080-
MtmRefreshClusterStatus(true,MtmReplicationNodeId);
3081-
MtmLock(LW_SHARED);
3082-
if (BIT_CHECK(Mtm->disabledNodeMask,MtmReplicationNodeId-1)) {
3083-
MtmUnlock();
3084-
elog(ERROR,"Disabled node %d tries to reconnect without recovery",MtmReplicationNodeId);
3085-
}
3073+
elog(ERROR,"Disabled node %d tries to reconnect without recovery",MtmReplicationNodeId);
30863074
}
30873075
}else {
30883076
MTM_LOG1("Node %d start logical replication to node %d in normal mode",MtmNodeId,MtmReplicationNodeId);

‎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
externXidStatusMtmGetCurrentTransactionStatus(void);
351351
externXidStatusMtmExchangeGlobalTransactionStatus(charconst*gid,XidStatusstatus);
352352
externboolMtmIsRecoveredNode(intnodeId);
353-
externboolMtmRefreshClusterStatus(boolnowait,inttestNodeId);
353+
externboolMtmRefreshClusterStatus(boolnowait);
354354
externvoidMtmSwitchClusterMode(MtmNodeStatusmode);
355355
externvoidMtmUpdateNodeConnectionInfo(MtmConnectionInfo*conn,charconst*connStr);
356356
externvoidMtmSetupReplicationHooks(structPGLogicalHooks*hooks);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp