Closed
Description
Persisting and applying a cluster state might be slow operations. If a node leaves the cluster today while doing one of these things then it will try and rejoin without necessarily waiting for the slow operation to complete, which in extreme cases may result in the node leaving the cluster again.
Similarly if the master fails then the other nodes will start running pre-voting phases to determine whether an election is likely to succeed, but this doesn't take account of any ongoing slow operations that would prevent the newly-elected master from completing its first publication.
We should make sure that we're not busy persisting or applying a cluster state before sending a join request or replying to a pre-vote request.