These are chat archives for akkadotnet/akka.net

28th
Apr 2018
Keith Nicholas
@keithn
Apr 28 2018 08:58
I'm just reading https://petabridge.com/blog/akkacluster-state-distribution/ It's kind of confusing at the end when it asks the question "how do I guarantee that my state is managed safely?" it makes reference to sharding, and then trys to explain how to do it. I think I might be missing something. When a new node joins a cluster and we get a repartitioning of the hash range, do the actors get moved around to different nodes?
so the actor with the state about "aaron" will get moved to a spot where everyone will still find the right actor
As far as I understand that's what the sharding module does. If so, without the sharding module, "how do I guarantee that my state is managed safely?" is you can't with nodes joining and leaving without some how moving actors?
Keith Nicholas
@keithn
Apr 28 2018 09:36
ah, I think I get it, that you ask some actor to broadcast a message to all nodes, then they all come back saying they have an actor, or not. If they all come back, then you create the actor. Seems like this is an expensive operation. So I'm guessing when you do this you want to design it so you hold on to the actorref as long as you can to minimize having to locate it. Seems like there's some edge cases as nodes join as you are trying to find things?
Keith Nicholas
@keithn
Apr 28 2018 10:16
So far my investigation of Akka.NET, to have a single entity with state live in a cluster seems to be not straight forward.
Keith Nicholas
@keithn
Apr 28 2018 10:32
Also, looking at the webcrawler example... doesn't it have a problem that if the MasterBroadcaster goes down, the system dies until a new node joins to trigger creation of a new masterbroadcaster?
Keith Nicholas
@keithn
Apr 28 2018 10:41
I'll just talk to myself :) ... No Keith, it won't, because when the next start job comes along it will cause a error, which will cause a restart and it will become the master broadcaster
Bartosz Sypytkowski
@Horusiath
Apr 28 2018 10:51
@keithn I'm not sure, but isn't cluster sharding a fair response to your question with aggregate state management?
also depends what do you mean by "state is managed safely". Do you mean, a consistent state? Since depending on your needs, you can manage state safely without hard consistency constraints (i.e. DistributeData plugin works that way).
Keith Nicholas
@keithn
Apr 28 2018 11:08
"state managed safely" is from the article, not me...... I'd guess it means consistent state. Yes, cluster sharding is layer to solve this, but you end up with some new problems to do with sharding. Also it seems the programming model doesn't seem super straight forward. It needs a db by default, but can use distributed data to do it also. but I'm not sure, I haven't tried it yet. It's all beta/experimental so no idea how battle hardened it is? And how would it all compare to using something like a clustered redis system to store state?
Also, back to the webcrawler, and the selection of a new masterbroadcaster, is there a potential race condition when two nodes fail to find a master broadcaster but neither see one and both try to become one?