[WIP] one leader per cluster team (#23239)

* Guarantee no sneaky type puts more teams in the role list

* Leader per team and initial tests

* MiMa filters

* Second iteration (not working though)

* Verbose gossip logging etc.

* Gossip to team-nodes even if there is inter-team unreachability

* More work ...

* Marking removed nodes with tombstones in Gossip

* More test coverage for Gossip.remove

* Bug failing other multi-node tests squashed

* Multi-node test for team-split

* Review fixes - only prune tombstones on leader ticks

* Clean code is happy code.

* All I want is for MiMa to be my friend

* These constants are internal

* Making the formatting gods happy

* I used the wrong reachability for ignoring gossip :/

* Still hadn't quite gotten how reachability was supposed to work

* Review feedback applied

* Cross-team downing should still work

* Actually prune tombstones in the prune tombstones method ...

* Another round against reachability. Reachability leading with 15 - 2 so far.
This commit is contained in:
Johan Andrén 2017-07-04 09:09:40 +01:00 committed by Patrik Nordwall
parent 0115d5fdda
commit 164387a89e
20 changed files with 1990 additions and 284 deletions

View file

@ -21,7 +21,7 @@ class ClusterMessageSerializerSpec extends AkkaSpec(
val ref = serializer.fromBinary(blob, obj.getClass)
obj match {
case env: GossipEnvelope
val env2 = obj.asInstanceOf[GossipEnvelope]
val env2 = ref.asInstanceOf[GossipEnvelope]
env2.from should ===(env.from)
env2.to should ===(env.to)
env2.gossip should ===(env.gossip)
@ -65,9 +65,11 @@ class ClusterMessageSerializerSpec extends AkkaSpec(
val g2 = (g1 :+ node3 :+ node4).seen(a1.uniqueAddress).seen(c1.uniqueAddress)
val reachability3 = Reachability.empty.unreachable(a1.uniqueAddress, e1.uniqueAddress).unreachable(b1.uniqueAddress, e1.uniqueAddress)
val g3 = g2.copy(members = SortedSet(a1, b1, c1, d1, e1), overview = g2.overview.copy(reachability = reachability3))
val g4 = g1.remove(d1.uniqueAddress, 352684800)
checkSerialization(GossipEnvelope(a1.uniqueAddress, uniqueAddress2, g1))
checkSerialization(GossipEnvelope(a1.uniqueAddress, uniqueAddress2, g2))
checkSerialization(GossipEnvelope(a1.uniqueAddress, uniqueAddress2, g3))
checkSerialization(GossipEnvelope(a1.uniqueAddress, uniqueAddress2, g4))
checkSerialization(GossipStatus(a1.uniqueAddress, g1.version))
checkSerialization(GossipStatus(a1.uniqueAddress, g2.version))