For a stateful service, does it run/execute the process in RunAsync on the secondary replicas?
Asked
Active
Viewed 529 times
1 Answers
4
RunAsync only runs on primaries of your partitions for Stateful services.
The RunAsync method in a stateful service is executed only when the stateful service replica is primary. The RunAsync method is cancelled when a primary replica's role changes away from primary, as well as during the close and abort events.
For stateless it runs "when the instance is about to be used". https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-advanced-usage#stateless-service-instance-lifecycle
So for Stateful you can have one RunAsync per partition running (on the primaries), and for stateless one per instance.

yoape
- 3,285
- 1
- 14
- 27