Hi Brice,

Are you sure that it is the Sharding that is the issue and not something in the 
messages that you send to the sharded actors? As far as I can see, the sharding 
itself only persists string IDs of the entities and if you don't include any 
address specific information in there or persist actor refs in your sharded 
entries, you should be fine.

B/

On 27 February 2015 at 16:16:36, Brice Figureau (brice...@daysofwonder.com) 
wrote:

Hi,  

I was experimenting with the ClusterSharding system (the one in master  
with rememberEntries true) and persistence in a simplistic test that  
those the following:  

1) Start a ClusterSharding region on one node only  
2) start an entry, and communicate with it  
3) shutdown the ActorSystem  
4) Start a new ActorSystem (same name)  
5) Start the same ClusterSharding region  
6) expect the entry to be recreated by virtue of persistence and  
'rememberEntries'  

To my surprise it failed. The reason is that I add netty.tcp.port=0 in  
my configuration, which attributes a random port for each ActorSystem.  

Of course, in 4) the new ActorSystem has a distinct port from the one  
created at the start of the test. This means that when replaying the  
ShardCoordinator events, the unserialized ActorRef points to a different  
node than the current one, which later will create some issues since it  
doesn't exist anymore.  

Now, the problem is not this simplistic test (that I can fix by  
assigning a proper fixed port). It's when this system will be used in a  
production cluster where there's no guarantee that there will always be  
the same node present between restarts of the ShardCoordinator. For  
instance if I completely shutdown the production cluster, and recreate a  
new one on different EC2 instances (for instance) that would have  
completely different IP address, then the ShardCoordinator wouldn't be  
able to properly be configured.  

Is it a bug or did I miss something?  
--  
Brice Figureau <brice...@daysofwonder.com>  

--  
>>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.  
To post to this group, send email to akka-user@googlegroups.com.  
Visit this group at http://groups.google.com/group/akka-user.  
For more options, visit https://groups.google.com/d/optout.  
--
Björn Antonsson
Typesafe Inc. – Reactive Apps on the JVM
twitter: bantonsson

JOIN US. REGISTER TODAY!
Scala
Days
March 16th-18th,
San Francisco

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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