Disallow re-joining, see #2873
* Disallow join requests when already part of a cluster * Remove wipe state when joining, since join can only be performed from empty state * When trying to join, only accept gossip from that member * Ignore gossips from unknown (and unreachable) members * Make sure received gossip contains selfAddress * Test join of fresh node with same host:port * Remove JoinTwoClustersSpec * Welcome message as reply to Join * Retry unsucessful join request * AddressUidExtension * Uid in cluster Member identifier To be able to distinguish nodes with same host:port after restart. * Ignore gossip with wrong uid * Renamed Remove command to Shutdown * Use uid in vclock identifier * Update sample, Member apply is private * Disabled config duration syntax and cleanup of io settings * Update documentation
This commit is contained in:
parent
cdf717e855
commit
9e56ab6fe5
35 changed files with 795 additions and 546 deletions
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package akka.remote
|
||||
|
||||
import scala.concurrent.forkjoin.ThreadLocalRandom
|
||||
import akka.actor.ActorSystem
|
||||
import akka.actor.ExtendedActorSystem
|
||||
import akka.actor.Extension
|
||||
import akka.actor.ExtensionId
|
||||
import akka.actor.ExtensionIdProvider
|
||||
|
||||
/**
|
||||
* Extension that holds a uid that is assigned as a random `Int`.
|
||||
* The uid is intended to be used together with an [[akka.actor.Address]]
|
||||
* to be able to distinguish restarted actor system using the same host
|
||||
* and port.
|
||||
*/
|
||||
object AddressUidExtension extends ExtensionId[AddressUidExtension] with ExtensionIdProvider {
|
||||
override def get(system: ActorSystem): AddressUidExtension = super.get(system)
|
||||
|
||||
override def lookup = AddressUidExtension
|
||||
|
||||
override def createExtension(system: ExtendedActorSystem): AddressUidExtension = new AddressUidExtension(system)
|
||||
}
|
||||
|
||||
class AddressUidExtension(val system: ExtendedActorSystem) extends Extension {
|
||||
val addressUid: Int = ThreadLocalRandom.current.nextInt()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue