elasticsearch/elasticsearch — pull request #7781 by martijnvg (2014-09-18 11:02:17+00:00)
Title: Discovery: Remove redundant unsetting of the master flag

Also the can lead to an unexpected discovery issue in scenarios like this:
* node x picks a master, but the join request processing takes a bit longer, resulting in the new cluster state not being set before the join request returns
* Because of this there is another pinging round to find master.
* Cluster state is pushed to node x and master fd is being started
* Master fd fails and elects itself as master (there is no pinging round because one of the nodes is <1.4). Resulting in master flag being set to true
* Pinging round return, but another master is found due to stale unicast temporal responses. The master flag is then set to false.
* Any join request send to node x which is the master will fail continuously, because the master flag has been set back to false.