Cluster member status transition guards, see #2802

This commit is contained in:
Patrik Nordwall 2013-04-05 12:38:09 +02:00
parent 7e79bcd4ae
commit d2548285ac
4 changed files with 53 additions and 27 deletions

View file

@ -422,7 +422,8 @@ private[cluster] final class ClusterCoreDaemon(publisher: ActorRef) extends Acto
* State transition to LEAVING.
*/
def leaving(address: Address): Unit = {
if (latestGossip.members.exists(_.address == address)) { // only try to update if the node is available (in the member ring)
// only try to update if the node is available (in the member ring)
if (latestGossip.members.exists(m m.address == address && m.status == Up)) {
val newMembers = latestGossip.members map { m if (m.address == address) m.copy(status = Leaving) else m } // mark node as LEAVING
val newGossip = latestGossip copy (members = newMembers)