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

Commit112346a

Browse files
knizhnikkelvich
authored andcommitted
Update nConfigChanges together with disabledNodesMask
1 parente0896c1 commit112346a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

‎multimaster.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,7 @@ static void MtmStartRecovery()
14691469
{
14701470
MtmLock(LW_EXCLUSIVE);
14711471
BIT_SET(Mtm->disabledNodeMask,MtmNodeId-1);
1472+
Mtm->nConfigChanges+=1;
14721473
MtmSwitchClusterMode(MTM_RECOVERY);
14731474
Mtm->recoveredLSN=InvalidXLogRecPtr;
14741475
MtmUnlock();
@@ -1724,6 +1725,7 @@ static void MtmDisableNode(int nodeId)
17241725
elog(WARNING,"Disable node %d at xlog position %lx, last status change time %d msec ago",nodeId,GetXLogInsertRecPtr(),
17251726
(int)USEC_TO_MSEC(now-Mtm->nodes[nodeId-1].lastStatusChangeTime));
17261727
BIT_SET(Mtm->disabledNodeMask,nodeId-1);
1728+
Mtm->nConfigChanges+=1;
17271729
Mtm->nodes[nodeId-1].timeline+=1;
17281730
Mtm->nodes[nodeId-1].lastStatusChangeTime=now;
17291731
Mtm->nodes[nodeId-1].lastHeartbeat=0;/* defuse watchdog until first heartbeat is received */
@@ -1744,6 +1746,7 @@ static void MtmEnableNode(int nodeId)
17441746
{
17451747
BIT_CLEAR(Mtm->disabledNodeMask,nodeId-1);
17461748
BIT_CLEAR(Mtm->reconnectMask,nodeId-1);
1749+
Mtm->nConfigChanges+=1;
17471750
Mtm->nodes[nodeId-1].lastStatusChangeTime=MtmGetSystemTime();
17481751
Mtm->nodes[nodeId-1].lastHeartbeat=0;/* defuse watchdog until first heartbeat is received */
17491752
if (nodeId!=MtmNodeId) {
@@ -1765,6 +1768,7 @@ void MtmRecoveryCompleted(void)
17651768
Mtm->recoverySlot=0;
17661769
Mtm->recoveredLSN=GetXLogInsertRecPtr();
17671770
BIT_CLEAR(Mtm->disabledNodeMask,MtmNodeId-1);
1771+
Mtm->nConfigChanges+=1;
17681772
Mtm->reconnectMask |=SELF_CONNECTIVITY_MASK;/* try to reestablish all connections */
17691773
Mtm->nodes[MtmNodeId-1].lastStatusChangeTime=MtmGetSystemTime();
17701774
for (i=0;i<Mtm->nAllNodes;i++) {
@@ -1868,7 +1872,6 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
18681872
/* We are lucky: caught-up without locking cluster! */
18691873
}
18701874
MtmEnableNode(nodeId);
1871-
Mtm->nConfigChanges+=1;
18721875
caughtUp= true;
18731876
}elseif (!BIT_CHECK(Mtm->nodeLockerMask,nodeId-1)
18741877
&&slotLSN+MtmMinRecoveryLag>walLSN)
@@ -1953,6 +1956,7 @@ MtmCheckClusterLock()
19531956
Assert(Mtm->walSenderLockerMask==0);
19541957
Assert((Mtm->nodeLockerMask&Mtm->disabledNodeMask)==Mtm->nodeLockerMask);
19551958
Mtm->disabledNodeMask &= ~Mtm->nodeLockerMask;
1959+
Mtm->nConfigChanges+=1;
19561960
Mtm->nLiveNodes+=Mtm->nLockers;
19571961
Mtm->nLockers=0;
19581962
Mtm->nodeLockerMask=0;
@@ -2098,7 +2102,6 @@ void MtmRefreshClusterStatus()
20982102
*/
20992103
voidMtmCheckQuorum(void)
21002104
{
2101-
Mtm->nConfigChanges+=1;
21022105
if (Mtm->nLiveNodes<Mtm->nAllNodes/2+1) {
21032106
if (Mtm->status==MTM_ONLINE) {/* out of quorum */
21042107
elog(WARNING,"Node is in minority: disabled mask %lx", (long)Mtm->disabledNodeMask);
@@ -3655,6 +3658,7 @@ mtm_add_node(PG_FUNCTION_ARGS)
36553658
Mtm->nodes[nodeId].oldestSnapshot=0;
36563659

36573660
BIT_SET(Mtm->disabledNodeMask,nodeId);
3661+
Mtm->nConfigChanges+=1;
36583662
Mtm->nAllNodes+=1;
36593663
MtmUnlock();
36603664

‎tests2/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [ "$1" = 'postgres' ]; then
6969
multimaster.conn_strings = '$CONNSTRS'
7070
multimaster.heartbeat_recv_timeout = 1100
7171
multimaster.heartbeat_send_timeout = 250
72-
multimaster.min_2pc_timeout =100000
72+
multimaster.min_2pc_timeout =2000
7373
EOF
7474

7575
cat$PGDATA/postgresql.conf

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp