Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 03:29
    atrauzzi opened #4229
  • Feb 17 21:57
    Arkatufus edited #4228
  • Feb 17 21:46
    Arkatufus synchronize #4228
  • Feb 17 20:17
    Arkatufus synchronize #4228
  • Feb 17 19:55
    Arkatufus opened #4228
  • Feb 17 19:14
    Arkatufus synchronize #4226
  • Feb 17 18:28
    Aaronontheweb commented #4226
  • Feb 17 18:27
    Aaronontheweb commented #4226
  • Feb 17 18:23
    Aaronontheweb synchronize #4226
  • Feb 17 18:23

    Aaronontheweb on nuget

    (compare)

  • Feb 17 18:23

    Aaronontheweb on dev

    Bump Google.Protobuf from 3.11.… (compare)

  • Feb 17 18:23
    Aaronontheweb closed #4225
  • Feb 17 18:23

    Aaronontheweb on dev

    ActorSpawn benchmark tweaks (#4… (compare)

  • Feb 17 18:23
    Aaronontheweb closed #4227
  • Feb 17 18:17
    Aaronontheweb labeled #4227
  • Feb 17 18:17
    Aaronontheweb labeled #4227
  • Feb 17 18:17
    Aaronontheweb opened #4227
  • Feb 17 18:15
    Aaronontheweb commented #4226
  • Feb 17 18:13
    Arkatufus commented #4226
  • Feb 17 18:12
    Arkatufus commented #4226
Aaron Stannard
@Aaronontheweb
would be great to see more tools like that out in the .NET space
there's definitely demand for distributed scheduling capabilities
Blue
@heyixiaoran
@Horusiath sender is a send message node and receiver is a receive message node. They are both project name. I want to run multi send nodes and receive nodes . for example. run sender1 ,sender2 , receiver1. Then sender1 send message to shardid=1,entityid=1 and sender2 send message to shardid= 2,entityid=2 . I want receiver1 receive message from sender1 and sender2. Now I run a receiver2. Because it will rebalance . So I think receiver1 will receive message from sender1 and receiver2 will receive message from sender2. Do I miss some thing about rebalance ?
Bartosz Sypytkowski
@Horusiath

@heyixiaoran if you have two nodes (both running sharding), they will split new shards more or less evenly. But if you have already have a node with few shards on it, and then add new node to a cluster, the shards from old node don't have to migrate to new node immediately.

The heuristic here is that shard migration process is expensive, therefore it doesn't occur right away and it doesn't have to occur if difference in number of shards hosted between nodes is too small. Only if nodes have substantial difference between number of hosted shards (see reference config), a rebalancing will occur.

at least this is the default behavior
Blue
@heyixiaoran
@Horusiath So If I'm afraid one node will crush. Run two receiver node. I still don't know how to make receiver1 receive half messages and receiver2 receive other half messages.
Bartosz Sypytkowski
@Horusiath
@heyixiaoran cluster sharding is about fair allocation of actors/shards, not about fair splitting the message workload. This is what Cluster Routers excel in.
Dan
@ctrlaltdan

Hey everyone. I've been using cluster sharding in a development/CI environment for a while now and this error I'm getting is a recurring theme. The only way I can get my application back on track is to clear the event journal and allow the application to start from fresh...
Is there a bug here or have I configured something incorrectly?
I am using Kubernetes pods so each deployment will (or is highly likely to) have a new address. As the error states, there is no region deployed to that address (verified by lighthouse and PBM tool)
If I'm correct, in this instance, should the shard region not be reallocated?
Error:

[09:59:17 ERR] Exception in ReceiveRecover when replaying event type [Akka.Cluster.Sharding.PersistentShardCoordinator+ShardHomeAllocated] with sequence number [9] for persistenceId [/system/sharding/customerCoordinator/singleton/coordinator]
System.ArgumentException: Region [akka.tcp://imburse@10.240.0.79:8081/system/sharding/customer#594538619] not registered
Parameter name: e
   at Akka.Cluster.Sharding.PersistentShardCoordinator.State.Updated(IDomainEvent e)
   at Akka.Cluster.Sharding.PersistentShardCoordinator.ReceiveRecover(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Persistence.Eventsourced.<>c__DisplayClass91_0.<Recovering>b__1(Receive receive, Object message)

Sorry to be a pain but I'm not sure whether this is poor configuration (on my part) or if I should chalk this up as a bug. Does anyone have experience with how shard regions are allocated/reallocated?

Bartosz Sypytkowski
@Horusiath
@dubs999 it looks like your journal is corrupted for some reason. Your shard coordinator tries to recreate its state based on the journal, sees that shard has been allocated for the region that was not registered before (which is pretty impossible, since this is recovery mode, so it was correctly handled when storing an event first time). Did you delete events from your journal or something?
Dan
@ctrlaltdan
@Horusiath We don't have any code which deletes journals or snapshots. We're currently using SQL server, although only to maintain the current actor system state in the three EventJournal SnapshotStore and Metadata tables.
I'm under the assumption that the data was corrupted during a release. Maybe the actor system was downed before enough gossip/state was able to be written.
Our current infrastructure (Kubernetes) will re-deploy our stateless-set of shard-nodes at new addresses to those known by the Event Journal. Is this a potential limitation of the Cluster.Sharding module? I accept that it's in BETA.
Annoyingly I don't have a guaranteed repro for this but it has happened maybe 3 times this month (whilst still in development/CI)
Bartosz Sypytkowski
@Horusiath
@dubs999 I see that in the example log you have there, your sequence number is 9. Could you provide rows that happened before this seq nr for this persistenceId? SeqNr/PersistenceId/Manifest/SerializerId columns are actually the most important
Dan
@ctrlaltdan
@Horusiath I feel a bit silly for not taking a copy of the data! We had to purge the data to allow the application to function again. I'll have to get back to you with that next time it occurs.
I think I've found an open ticket for this already here: akkadotnet/akka.net#3414
Dan
@ctrlaltdan
Bartosz Sypytkowski
@Horusiath
ok, I see it
Blue
@heyixiaoran
@Horusiath Does shard just can have multi sender and one receiver ? It doesn't seem to be what I need . I want to use akka.net in a trading system. I want to set each login user as an actor and multiple server actors handle business . After server actor handle the message . It can reply the result to request actor. Does router can do this?
Bartosz Sypytkowski
@Horusiath

@heyixiaoran looks like you're talking about two different things:

  • If you have i.e. 10 000 users (actors) sharded on 10 nodes, you can get around (usually not exactly) 1000 actors on each node. That is fair actors allocation.
  • But that doesn't guarantee fair message distribution: you can have one actor receiving 1000 messages/sec and others having 1 message/sec.

It's like difference between memory and CPU.

If you want to model users as actors, then cluster sharding is probably what you're looking for. They can always reply to requester (however replying to sharded actor works in a different way than replying to normal actor).
DSanchen
@DSanchen
I still have the issue, that ActorSelection.ResolveOne does not find an Actor that was created using ActorOfAsTestActorRef. What I now tried is Ask<>()-ing the Actor
something before trying to resolve it, and ideed I get an answer to the Ask<>(), but it still happens that ResolveOne does not find it. I tried looking in the source-code
of ActorSelection / ActorOfAsTestActorRef, but at some point I got stuck and could not understand what was going on... Only thing I think I understood, is that someone must answer with ActorIdentity(MsgId, null) upon receiving an Identify(MsgId)-Message... Any good Ideas ?
Dan
@ctrlaltdan

@Horusiath The issue happened again. Here is a dump of the data.

Ordering PersistenceId SequenceNr Timestamp IsDeleted Manifest Payload Tags SerializerId
136 /system/sharding/customerCoordinator/singleton/coordinator 105 636783291061582824 0 AF 0x0A0233361248616B6B612E7463703A2F2F696D62757273654031302E3234302E302E3130383A383038312F73797374656D2F7368617264696E672F637573746F6D65722331363635343832363933 NULL 13
140 /system/sharding/customerCoordinator/singleton/coordinator 106 636784965012362487 0 AB 0x0A47616B6B612E7463703A2F2F696D62757273654031302E3234302E302E3132323A383038312F73797374656D2F7368617264696E672F637573746F6D657223323432333036343237 NULL 13
141 /system/sharding/customerCoordinator/singleton/coordinator 107 636784965012552987 0 AC 0x0A4C616B6B612E7463703A2F2F696D62757273654031302E3234302E302E35333A383038312F73797374656D2F7368617264696E672F637573746F6D657250726F78792332313137333131313037 NULL 13
142 /system/sharding/customerCoordinator/singleton/coordinator 108 636784965012782458 0 AC 0x0A4D616B6B612E7463703A2F2F696D62757273654031302E3234302E302E3132363A383038312F73797374656D2F7368617264696E672F637573746F6D657250726F78792331323135343337333535 NULL 13
143 /system/sharding/customerCoordinator/singleton/coordinator 109 636784965126035293 0 AD 0x0A46616B6B612E7463703A2F2F696D62757273654031302E3234302E302E33303A383038312F73797374656D2F7368617264696E672F637573746F6D657223393630383739383036 NULL 13
144 /system/sharding/customerCoordinator/singleton/coordinator 110 636784965229904859 0 AB 0x0A46616B6B612E7463703A2F2F696D62757273654031302E3234302E302E31343A383038312F73797374656D2F7368617264696E672F637573746F6D657223373231343333303930 NULL 13

With the exception:

Exception in ReceiveRecover when replaying event type ["Akka.Cluster.Sharding.PersistentShardCoordinator+ShardHomeAllocated"] with sequence number [105] for persistenceId ["/system/sharding/customerCoordinator/singleton/coordinator"]

{
  "Depth": 0,
  "ClassName": "",
  "Message": "Region [akka.tcp://imburse@10.240.0.108:8081/system/sharding/customer#1665482693] not registered\nParameter name: e",
  "Source": "Akka.Cluster.Sharding",
  "StackTraceString": "   at Akka.Cluster.Sharding.PersistentShardCoordinator.State.Updated(IDomainEvent e)\n   at Akka.Cluster.Sharding.PersistentShardCoordinator.ReceiveRecover(Object message)\n   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)\n   at Akka.Persistence.Eventsourced.<>c__DisplayClass91_0.<Recovering>b__1(Receive receive, Object message)",
  "RemoteStackTraceString": "",
  "RemoteStackIndex": -1,
  "HResult": -2147024809,
  "HelpURL": null
}

Would you like me to create this as a bug in the issue tracker?

Lutando Ngqakaza
@Lutando
I have quite a specific question, is it possible to inject an EventAdapter for a given persistence plugin outside of the hocon methodology, something at runtime where I can use an Extension to do this? Long shot question basically I want to add an event tagger to the actor system
Aaron Stannard
@Aaronontheweb
@dubs999 yes please
Bartosz Sypytkowski
@Horusiath
@Lutando unfortunately no. Only via HOCON
DSanchen
@DSanchen

Hi Guys, I have a question regardig FlowOps.GroupedWithin()
A small timing Diagram:

==> Time-Axis

| e e e e e e e          .e e e e e e 
|--------t-----|--------t.-------|--------t--------|
              #          .       #  x              #
              #          .       #  x              #
              #          |-------#t-x|--------t----#---|
              #                  #  x              #
              1                  2  x              3
                                    x
                                    4

GroupedWihin emits when the amount of grouped elements reaches the defined limit, or the time since the last emitted group exceeds the defined timeout.
In my example GroupedWithin(6, t) this will emit a complete group at time 1, another partially filled group (4 elements) at time 2 and another parially filled group (2 elements) at time 3.
I need a behaviour, that emits when the amount of grouped element reaches the defined limit, or the time since the first received element of the current group exceeds the defined timeout... That would emit the first group at time 1, and the next completely filled group at time 4.
Is there such a Grouping behaviour ?

Maciek Misztal
@mmisztal1980

I've just tried using Akka.Quartz.Actor.QuartzActor using Akka.System.ActorOf(Props.Create(() => new QuartzActor()), "scheduler"); in a .net core 2.1 app and got a:

[akka://System/user/scheduler#154807920]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Akka.Quartz.Actor.QuartzActor with 0 args: () ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
   at Quartz.Impl.StdSchedulerFactory.Initialize()
   at Quartz.Impl.StdSchedulerFactory.GetScheduler() in c:\projects\quartznet\src\Quartz\Impl\StdSchedulerFactory.cs:line 1102
   at Akka.Quartz.Actor.QuartzActor..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Akka.Actor.Props.ActivatorProducer.Produce()
   at Akka.Actor.Props.NewActor()
   --- End of inner exception stack trace ---
   at Akka.Actor.Props.NewActor()
   at Akka.Actor.ActorCell.CreateNewActorInstance()
   at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<NewActor>b__0()
   at Akka.Actor.ActorCell.UseThreadContext(Action action)
   at Akka.Actor.ActorCell.NewActor()
   at Akka.Actor.ActorCell.Create(Exception failure)
   --- End of inner exception stack trace ---
   at Akka.Actor.ActorCell.Create(Exception failure)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)

any suggestions how to get rid of this? I take it, this extension is not under active development? From the initial looks of it, it seems to be targeting .NET 4.5.2 ?

Bartosz Sypytkowski
@Horusiath
@mmisztal1980 it looks so. Maybe it wasn't updated for a while? You could give a try to Akka.Persistence.Reminders - it's a bit simpler, and relies only on akka persistence. If you try it, your feedback will be welcome.
Maciek Misztal
@mmisztal1980
@horusiath I’l give it a shot
Filip Nowak
@fipil
Hi, I'm a newbie in the akka.net world. I readed a lot about it and I like it very much. But I still doesn't understand one thing: for example, if I'd like to create an eshop with using akka.net and I've a catalog with 100000 items. Where are these items stored? Will I have a 100000 actors, one per a catalog item? I'm sorry for the stupid question, I'm coming from relational database centric development world, so this I still dont understand. Many thanks.
Vagif Abilov
@object
Hello. We are using cluster sharding in a combination with DistributedData. DistributedData is still marked as "experimental" in Akka.NET docs, but are there any known issues with it? The documentation says "At this moment this mode doesn't support akka.cluster.sharding.remember-entities option", but this line has been there since the version 1.3.2, and I hope that remember-entities can be used now with ddata (we need it badly). Does anyone know the current state of this issue?
jameswilddev
@jameswilddev
Am I right in thinking that DistributedData is an in-memory, i.e. non-persistent store? What would remember-entities do when backing onto such a system?
Paweł Bańka
@pmbanka
@jameswilddev remember-entities is a setting that causes automatic starting of entities in case of shard rebalancing. Yes DistributedData is in-memory, but as long as there are some nodes of the cluster left (which is a case in of moving a shard from one node to another) the data should be still accessible. Note that JVM Akka supports this (https://doc.akka.io/docs/akka/2.5/cluster-sharding.html#remembering-entities).
Ismael Hamed
@ismaelhamed
@pmbanka @object @jameswilddev At least in the JVM, since 2.5 remember entities are stored with durable ddata. Given DistributedData in Akka.NET uses LMDB too, I'm guessing it should do the same.
Alexandr Baranovskyi
@baranovskyi1_gitlab
Hello!
Wanted to ask a quick question, is it possible to set two lighthouses as seed-nodes for each other?
I tried to do it, but both of them get stuck in infinite loops of reconnection.
However, once I remove the cycle (delete one of the references) everything goes back to normal.
Maciek Misztal
@mmisztal1980
Can anyone elaborate if it’s feasible to create actor hierarchies running in shards?
Boris Lange
@langebo
Hey, i have a question concerning stateful/persistent actors in general. we have actors and their state is represented via domain models. some of those domain models have other domain models as nested entities. we naively just assigned the state of actors as the nested properties of other actors state objects and recently found out that after restart and recovery, updating the original actor state will not update the (prior same) objects that are nested in others actors state. now my question: what is the best design choice for having stateful/persistent actors, with nested state properties of other actors and have them being updated by just updating the primary actors state?
should we only ever store ids/actorrefs of nested actors state and resolve their state when performing actions where we need their data or are c# refs a solution (ptr-ish)? or is there a solution that we are just missing?
Vagif Abilov
@object
@mmisztal1980 You mean creating a root actor in a shard and spawning a hierarchy of child actors? No problem with that.
@langebo It makes sense (and simplifies a few things) if you associate persistent state with the state of your aggregate root in DDD terms. You can still persist events associated with nested (smaller) scope, but they all should contribute in building up a state of the aggregate.
Boris Lange
@langebo
@object Ok to make my question more concrete. I have persistent actors: ResourceActor with a state class Resource and an AppointmentActor with a state class Appointment. Appointment has a list of Resource objects. Given that i instantiate multiple ResourceActors with their respective state objects and an AppointmentActor with their respective state containing some of my Resource state objects, what we are experiencing is, that when i change the state of a Resource state object and it gets persisted, the changes on that object are not reflected in the Resources list of my Appointment after restarting and replaying my actor system. Means the Resource IS changed. Its occurence in the Appointments list of resources IS NOT. (Because after replaying both aren't the same object instantiation anymore and the state change of the resource is not replayed in the context of the Appointment)
By the way: when i talk about domain models, i dont mean that we are following the DDD principles (which we probably should but thats another topic i guess)
Vagif Abilov
@object
@langebo When working with actors it's best no to think in OOP terms. It's all about messages. When you build a state of AppointementActor from its events you are replaying messages that were received and persisted for the given AppointmentActor persistence ID. Events come from the event journal (event store). If AppointementActor state should include more than that (e.g. a number of ResourceActor events), then you have to arrange it yourself. This is why I'd go for storing all contained events under the same persistence ID (corresponding to the aggregate root, in your case it will be AppointmentActor).
James Hulse
@jameshulse
hi all, I worked on an akka.net system 2 years ago but have nearly forgotten everything I learned. trying to get back up to speed but can't seem to find the really great article on the "work pulling pattern" that I had back then. Anybody know which one I might be referring to or where I can find something similar now? cheers
Aaron Stannard
@Aaronontheweb
push and pull?
but we don't cover it there
Alexandr Baranovskyi
@baranovskyi1_gitlab
@Aaronontheweb is there any documentation on how Lighthouse should be started and configured?
It seems like there's a lot of custom cases that aren't described anywhere (seed-node cycle, as I wrote in the previous message, and constant gateway association errors if lighthouse referenced by another lighthouse starts later than latter)
edwinparker
@edwinparker
I'm using NLog to log errors in my akka app. I would like to be able to add additional data to the exception before it logs...including the message value. I was using PreRestart override for this which works, but I noticed the error often gets logged before that event is triggered so sometimes the extra data is not included. Where would be the appropriate place to do this kind of logging? Do I need a custom logger or some other approach?
atresnjo
@atresnjo
Is there a way to send a "global" message in akka? as in notify every known actor in the system.
Arjen Smits
@Danthar
@atresnjo take a look at actorselections and how addresses work: https://getakka.net/articles/concepts/addressing.html#querying-the-logical-actor-hierarchy
atresnjo
@atresnjo
Yeah I can know that I can do it myself, question was more like if there's something already inbuilt.