Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 62e1084

Browse files
committed
handle situation when winner node rebooted in usual online mode (due to neighbor becaming alive)
1 parent 83efe72 commit 62e1084

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

state.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,22 @@ MtmSetClusterStatus(MtmNodeStatus status)
8383
Mtm->recoveryCount++; /* this will restart replication connection */
8484
}
8585

86+
/*
87+
* Check saved referee decision and clean it
88+
*/
89+
if (status == MTM_ONLINE)
90+
{
91+
if (!Mtm->refereeGrant && MtmRefereeReadSaved() > 0)
92+
{
93+
/*
94+
* We booted after being with refereeGrant,
95+
* but now have ordinary majority.
96+
*/
97+
MtmPollStatusOfPreparedTransactions(true);
98+
MtmRefereeClearWinner();
99+
}
100+
}
101+
86102
Mtm->status = status;
87103
}
88104

@@ -482,8 +498,9 @@ MtmRefreshClusterStatus()
482498
* because we can clean old value before failed node starts it recovery and that node
483499
* can get refereeGrant before start of walsender, so it start in recovered mode.
484500
*/
485-
if (MtmRefereeConnStr && *MtmRefereeConnStr && Mtm->refereeWinnerId &&
486-
countZeroBits(Mtm->disabledNodeMask, Mtm->nAllNodes) == Mtm->nAllNodes)
501+
if (MtmRefereeConnStr && *MtmRefereeConnStr && Mtm->refereeWinnerId &&
502+
countZeroBits(Mtm->disabledNodeMask, Mtm->nAllNodes) == Mtm->nAllNodes &&
503+
MtmGetCurrentStatus() == MTM_ONLINE) /* restrict this actions only to major -> online transition */
487504
{
488505
if (MtmRefereeClearWinner())
489506
{

0 commit comments

Comments
 (0)