MXS-831: Detect new_master events
The new_master events were mistakenly detected as lost_slave events.
This commit is contained in:
@ -711,8 +711,14 @@ mon_get_event_type(MONITOR_SERVERS* node)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/** These are used to detect whether we actually lost something or
|
||||||
|
* just transitioned from one state to another */
|
||||||
|
unsigned int prev_bits = prev & (SERVER_MASTER | SERVER_SLAVE);
|
||||||
|
unsigned int present_bits = present & (SERVER_MASTER | SERVER_SLAVE);
|
||||||
|
|
||||||
/* Was running and still is */
|
/* Was running and still is */
|
||||||
if (prev & (SERVER_MASTER | SERVER_SLAVE | SERVER_JOINED | SERVER_NDB))
|
if ((!prev_bits || !present_bits || prev_bits == present_bits) &&
|
||||||
|
prev & (SERVER_MASTER | SERVER_SLAVE | SERVER_JOINED | SERVER_NDB))
|
||||||
{
|
{
|
||||||
/* We used to know what kind of server it was */
|
/* We used to know what kind of server it was */
|
||||||
event_type = LOSS_EVENT;
|
event_type = LOSS_EVENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user