You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elog(WARNING, "Node %d thinks that I am dead, while I am %s (message %s)", resp->node, MtmNodeStatusMnem[Mtm->status], MtmMessageKindMnem[resp->code]);
BIT_SET(Mtm->nodeLockerMask, MtmNodeId-1); /* it is trik: this mask was originally use by WAL senders performing recovery, but here we are in opposite (recovered) side:
1873
1874
* if this mask is not zero loadReq will be broadcasted to all other nodes by heartbeat, suspending their activity
1874
1875
*/
1875
-
MtmSwitchClusterMode(MTM_CONNECTED);
1876
+
MtmSwitchClusterMode(MTM_RECOVERED);
1876
1877
}
1877
1878
MtmUnlock();
1878
1879
}
@@ -2030,35 +2031,17 @@ MtmCheckClusterLock()
2030
2031
timestamp_tdelay=MIN_WAIT_TIMEOUT;
2031
2032
while (true)
2032
2033
{
2033
-
nodemask_tmask=Mtm->walSenderLockerMask;
2034
-
if (Mtm->globalLockerMask | mask) {
2035
-
if (Mtm->nActiveTransactions==0) {
2036
-
lsn_tcurrLogPos=GetXLogInsertRecPtr();
2037
-
inti;
2038
-
for (i=0; mask!=0; i++, mask >>= 1) {
2039
-
if (mask&1) {
2040
-
if (WalSndCtl->walsnds[i].sentPtr!=currLogPos) {
2041
-
/* recovery is in progress */
2042
-
break;
2043
-
} else {
2044
-
/* recovered replica caught up with master */
2045
-
MTM_LOG1("WAL-sender %d complete recovery", i);
2046
-
BIT_CLEAR(Mtm->walSenderLockerMask, i);
2047
-
}
2048
-
}
2049
-
}
2034
+
if (Mtm->globalLockerMask | Mtm->walSenderLockerMask) {
2035
+
/* some "almost cautch-up" wal-senders are still working. */
2036
+
/* Do not start new transactions until them are completed. */
2037
+
MtmUnlock();
2038
+
MtmSleep(delay);
2039
+
if (delay*2 <= MAX_WAIT_TIMEOUT) {
2040
+
delay *= 2;
2050
2041
}
2051
-
if (Mtm->globalLockerMask | mask) {
2052
-
/* some "almost cautch-up" wal-senders are still working. */
2053
-
/* Do not start new transactions until them are completed. */
2054
-
MtmUnlock();
2055
-
MtmSleep(delay);
2056
-
if (delay*2 <= MAX_WAIT_TIMEOUT) {
2057
-
delay *= 2;
2058
-
}
2059
-
MtmLock(LW_EXCLUSIVE);
2060
-
continue;
2061
-
} else {
2042
+
MtmLock(LW_EXCLUSIVE);
2043
+
} else {
2044
+
if (Mtm->nodeLockerMask!=0) {
2062
2045
/* All lockers have synchronized their logs */
2063
2046
/* Remove lock and mark them as recovered */
2064
2047
MTM_LOG1("Complete recovery of %d nodes (node mask %llx)", Mtm->nLockers, Mtm->nodeLockerMask);
0 commit comments