Skip to content

Commit

Permalink
Fix edge case during promotion #959
Browse files Browse the repository at this point in the history
If a slave was shunned because replication was broken, when it becomes a master it was staying shunned
  • Loading branch information
renecannao committed Mar 23, 2017
1 parent 3dfb383 commit 50e010b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/MySQL_HostGroups_Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,11 @@ void MySQL_HostGroups_Manager::replication_lag_action(int _hid, char *address, u
}
} else {
if (mysrvc->status==MYSQL_SERVER_STATUS_SHUNNED_REPLICATION_LAG) {
if (current_replication_lag>=0 && ((unsigned int)current_replication_lag <= mysrvc->max_replication_lag)) {
if (
(current_replication_lag>=0 && ((unsigned int)current_replication_lag <= mysrvc->max_replication_lag))
||
(current_replication_lag==-2) // see issue 959
) {
mysrvc->status=MYSQL_SERVER_STATUS_ONLINE;
}
}
Expand Down

0 comments on commit 50e010b

Please sign in to comment.