Cluster singleton testing (#21803)

* add another singleton restart test

* remove from singleton sorted set with unique address

* because the upNumber used by the Ordering can change
This commit is contained in:
Patrik Nordwall 2016-11-12 00:10:30 +01:00 committed by Konrad Malawski
parent 9c087d115e
commit 88a6bdb059
2 changed files with 137 additions and 2 deletions

View file

@ -262,14 +262,17 @@ object ClusterSingletonManager {
def add(m: Member): Unit = {
if (matchingRole(m))
trackChange { ()
membersByAge -= m // replace
// replace, it's possible that the upNumber is changed
membersByAge = membersByAge.filterNot(_.uniqueAddress == m.uniqueAddress)
membersByAge += m
}
}
def remove(m: Member): Unit = {
if (matchingRole(m))
trackChange { () membersByAge -= m }
trackChange { ()
membersByAge = membersByAge.filterNot(_.uniqueAddress == m.uniqueAddress)
}
}
def sendFirstChange(): Unit = {