elasticsearch/elasticsearch — pull request #6230 by bleskes (2014-05-19 10:55:10+00:00)
Title: Do not execute cluster state changes if current node is no longer master

When a node steps down from being a master (because, for example, min_master_node is breached), it may still have cluster state update tasks queued up. Most (but not all) are tasks that should no longer be executed as the node no longer has authority to do so. Other cluster states updates, like electing the current node as master, should be executed even if the current node is no longer master.

This commit make sure that, by default, `ClusterStateUpdateTask` is not executed if the node is no longer master. Tasks that should run on non masters are changed to implement a new interface called `ClusterStateNonMasterUpdateTask`

Note - this PR is done against the `feature/improve_zen` branch, where we will give CI some time test it.