elasticsearch/elasticsearch — pull request #7558 by bleskes (2014-09-03 12:19:56+00:00)
Title: [Discovery] Master election should demotes nodes which try to join the cluster for the first time

With the change in #7493 , we introduced a pinging round when a master nodes goes down. That pinging round helps validating the current state of the cluster and takes, by default, 3 seconds. It may be that during that window, a new node tries to join the cluster and starts pinging (this is typical when you quickly restart the current master). If this node gets elected as the new master it will force recovery from the gateway (it has no in memory cluster state), which in turn will cause a full cluster shard synchronisation. While this is not a problem on it's own, it's a shame. This commit demotes "new" nodes during master election so the will only be elected if really needed.