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
}
@@ -2029,35 +2030,17 @@ MtmCheckClusterLock()
2029
2030
timestamp_tdelay=MIN_WAIT_TIMEOUT;
2030
2031
while (true)
2031
2032
{
2032
-
nodemask_tmask=Mtm->walSenderLockerMask;
2033
-
if (Mtm->globalLockerMask | mask) {
2034
-
if (Mtm->nActiveTransactions==0) {
2035
-
lsn_tcurrLogPos=GetXLogInsertRecPtr();
2036
-
inti;
2037
-
for (i=0; mask!=0; i++, mask >>= 1) {
2038
-
if (mask&1) {
2039
-
if (WalSndCtl->walsnds[i].sentPtr!=currLogPos) {
2040
-
/* recovery is in progress */
2041
-
break;
2042
-
} else {
2043
-
/* recovered replica caught up with master */
2044
-
MTM_LOG1("WAL-sender %d complete recovery", i);
2045
-
BIT_CLEAR(Mtm->walSenderLockerMask, i);
2046
-
}
2047
-
}
2048
-
}
2033
+
if (Mtm->globalLockerMask | Mtm->walSenderLockerMask) {
2034
+
/* some "almost cautch-up" wal-senders are still working. */
2035
+
/* Do not start new transactions until them are completed. */
2036
+
MtmUnlock();
2037
+
MtmSleep(delay);
2038
+
if (delay*2 <= MAX_WAIT_TIMEOUT) {
2039
+
delay *= 2;
2049
2040
}
2050
-
if (Mtm->globalLockerMask | mask) {
2051
-
/* some "almost cautch-up" wal-senders are still working. */
2052
-
/* Do not start new transactions until them are completed. */
2053
-
MtmUnlock();
2054
-
MtmSleep(delay);
2055
-
if (delay*2 <= MAX_WAIT_TIMEOUT) {
2056
-
delay *= 2;
2057
-
}
2058
-
MtmLock(LW_EXCLUSIVE);
2059
-
continue;
2060
-
} else {
2041
+
MtmLock(LW_EXCLUSIVE);
2042
+
} else {
2043
+
if (Mtm->nodeLockerMask!=0) {
2061
2044
/* All lockers have synchronized their logs */
2062
2045
/* Remove lock and mark them as recovered */
2063
2046
MTM_LOG1("Complete recovery of %d nodes (node mask %llx)", Mtm->nLockers, Mtm->nodeLockerMask);
0 commit comments