On Mon, Jun 9, 2014 at 8:41 PM, Luis Medina <[email protected]> wrote:
> How many entries does the currentShardAllocations Map >> (actorRefIndexedSeqMap in your code) have when allocateShard is invoked for >> shard "1" and shard "2"? > > > I'll have to check, not sure. > > >> i.e. you have only one entry in currentShardAllocations. >> > > Even if there was one entry in currentShardAllocations from the first > shard, wouldn't the other ShardRegion see this and thus create the second > shard on the node that doesn't have any shards yet based on the fact that I > passed in 1 for the rebalanceThreshold parameter of the > LeastShardAllocationStrategy? > The allocation strategy is used by the coordinator, a cluster singleton. The currentShardAllocations will contain one entry for each registered region actor (one per node). I think your currentShardAllocations only contains one entry, i.e. both nodes have not registered when you send the messages. > > It might be that not all shard regions have registered themselves to the >> coordinator yet, > > > Could this still be true if I'm setting the min-nr-of-members = 2 in my > configuration? > Yes, that will not happen at the same time on all nodes. > I figured that doing this would cause the cluster to wait long enough > before creating the entries so that the allocateShard could work properly. > I might be starting up both of my nodes too quickly though. For example, > the first seed node will not having even logged the fact that it joined a > role before the second node is started. Maybe waiting a few seconds for the > first seed node to get properly started up before starting the other node > could solve this issue? > You can try such things when debugging, but relying on timing is not a good final solution. /Patrik > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw <http://www.scaladays.org/> -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
