I have a 2 node akka cluster. I am trying to run a persistent actor with 
cluster sharding.
When the ShardCoordinator starts up, it is throwing an 
IllegalArgumentException. After digging through the source code, I found it 
to be a require statement in ClusterSharding.scala

 case ShardHomeAllocated(shard, region) ⇒
          require(regions.contains(region), s"Region $region not 
registered: $this")


When the ShardCoordinator is started up on app01 (the first node) and it 
receives a region from app02 in the event ShardHomeAllocated, the require 
statement fails. It also fails when the converse happens. (When 
ShardCoordinator is started on app02 and it gets an event with region the 
actor from app01). The 'regions' contained in the actor's state must come 
from the snapshot which may not contain the region being allocated in the 
above event. 

This is what it looks like on app01. Note that the Region actor is from 
app02.

2015-06-25 14:17:12,017 ERROR akka.actor.OneForOneStrategy - requirement 
failed: Region 
Actor[akka.tcp://evernym@app02:2551/user/sharding/Subr#-317090222] 
not registered: State(Map(8 -> 
Actor[akka://evernym/user/sharding/Subr#1934748057]),Map(Actor[akka://evernym/user/sharding/Subr#1934748057]
 
-> Vector(8)),Set())
java.lang.IllegalArgumentException: requirement failed: Region Actor[akka.
tcp://evernym@app02:2551/user/sharding/Subr#-317090222] not registered: 
State(Map(8 -> Actor[akka:

After this exception is thrown, the actor restarts, recovers from snapshot, 
applies that event and throws an exception again, going into an infinite 
restart loop. 

Any idea why this could be happening?


Thanks,
Joseph

-- 
>>>>>>>>>>      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.

Reply via email to