@@ -1469,6 +1469,7 @@ static void MtmStartRecovery()
1469
1469
{
1470
1470
MtmLock (LW_EXCLUSIVE );
1471
1471
BIT_SET (Mtm -> disabledNodeMask , MtmNodeId - 1 );
1472
+ Mtm -> nConfigChanges += 1 ;
1472
1473
MtmSwitchClusterMode (MTM_RECOVERY );
1473
1474
Mtm -> recoveredLSN = InvalidXLogRecPtr ;
1474
1475
MtmUnlock ();
@@ -1724,6 +1725,7 @@ static void MtmDisableNode(int nodeId)
1724
1725
elog (WARNING , "Disable node %d at xlog position %lx, last status change time %d msec ago" , nodeId , GetXLogInsertRecPtr (),
1725
1726
(int )USEC_TO_MSEC (now - Mtm -> nodes [nodeId - 1 ].lastStatusChangeTime ));
1726
1727
BIT_SET (Mtm -> disabledNodeMask , nodeId - 1 );
1728
+ Mtm -> nConfigChanges += 1 ;
1727
1729
Mtm -> nodes [nodeId - 1 ].timeline += 1 ;
1728
1730
Mtm -> nodes [nodeId - 1 ].lastStatusChangeTime = now ;
1729
1731
Mtm -> nodes [nodeId - 1 ].lastHeartbeat = 0 ; /* defuse watchdog until first heartbeat is received */
@@ -1744,6 +1746,7 @@ static void MtmEnableNode(int nodeId)
1744
1746
{
1745
1747
BIT_CLEAR (Mtm -> disabledNodeMask , nodeId - 1 );
1746
1748
BIT_CLEAR (Mtm -> reconnectMask , nodeId - 1 );
1749
+ Mtm -> nConfigChanges += 1 ;
1747
1750
Mtm -> nodes [nodeId - 1 ].lastStatusChangeTime = MtmGetSystemTime ();
1748
1751
Mtm -> nodes [nodeId - 1 ].lastHeartbeat = 0 ; /* defuse watchdog until first heartbeat is received */
1749
1752
if (nodeId != MtmNodeId ) {
@@ -1765,6 +1768,7 @@ void MtmRecoveryCompleted(void)
1765
1768
Mtm -> recoverySlot = 0 ;
1766
1769
Mtm -> recoveredLSN = GetXLogInsertRecPtr ();
1767
1770
BIT_CLEAR (Mtm -> disabledNodeMask , MtmNodeId - 1 );
1771
+ Mtm -> nConfigChanges += 1 ;
1768
1772
Mtm -> reconnectMask |= SELF_CONNECTIVITY_MASK ; /* try to reestablish all connections */
1769
1773
Mtm -> nodes [MtmNodeId - 1 ].lastStatusChangeTime = MtmGetSystemTime ();
1770
1774
for (i = 0 ; i < Mtm -> nAllNodes ; i ++ ) {
@@ -1868,7 +1872,6 @@ bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN)
1868
1872
/* We are lucky: caught-up without locking cluster! */
1869
1873
}
1870
1874
MtmEnableNode (nodeId );
1871
- Mtm -> nConfigChanges += 1 ;
1872
1875
caughtUp = true;
1873
1876
} else if (!BIT_CHECK (Mtm -> nodeLockerMask , nodeId - 1 )
1874
1877
&& slotLSN + MtmMinRecoveryLag > walLSN )
@@ -1953,6 +1956,7 @@ MtmCheckClusterLock()
1953
1956
Assert (Mtm -> walSenderLockerMask == 0 );
1954
1957
Assert ((Mtm -> nodeLockerMask & Mtm -> disabledNodeMask ) == Mtm -> nodeLockerMask );
1955
1958
Mtm -> disabledNodeMask &= ~Mtm -> nodeLockerMask ;
1959
+ Mtm -> nConfigChanges += 1 ;
1956
1960
Mtm -> nLiveNodes += Mtm -> nLockers ;
1957
1961
Mtm -> nLockers = 0 ;
1958
1962
Mtm -> nodeLockerMask = 0 ;
@@ -2098,7 +2102,6 @@ void MtmRefreshClusterStatus()
2098
2102
*/
2099
2103
void MtmCheckQuorum (void )
2100
2104
{
2101
- Mtm -> nConfigChanges += 1 ;
2102
2105
if (Mtm -> nLiveNodes < Mtm -> nAllNodes /2 + 1 ) {
2103
2106
if (Mtm -> status == MTM_ONLINE ) { /* out of quorum */
2104
2107
elog (WARNING , "Node is in minority: disabled mask %lx" , (long ) Mtm -> disabledNodeMask );
@@ -3655,6 +3658,7 @@ mtm_add_node(PG_FUNCTION_ARGS)
3655
3658
Mtm -> nodes [nodeId ].oldestSnapshot = 0 ;
3656
3659
3657
3660
BIT_SET (Mtm -> disabledNodeMask , nodeId );
3661
+ Mtm -> nConfigChanges += 1 ;
3658
3662
Mtm -> nAllNodes += 1 ;
3659
3663
MtmUnlock ();
3660
3664
0 commit comments