Members ordered by address only, see #2405

* The special ordering of status Exiting makes ordering and equals
  inconsistent
* Take the Exiting status into account when looking for leader
This commit is contained in:
Patrik Nordwall 2012-08-19 21:48:39 +02:00
parent 7f1a4d3ab6
commit 6d1631aa8c
6 changed files with 37 additions and 38 deletions

View file

@ -572,7 +572,7 @@ private[cluster] final class ClusterCoreDaemon(environment: ClusterEnvironment)
val localGossip = latestGossip
val localMembers = localGossip.members
val isLeader = localMembers.nonEmpty && (selfAddress == localMembers.head.address)
val isLeader = localGossip.isLeader(selfAddress)
if (isLeader && isAvailable) {
// only run the leader actions if we are the LEADER and available