2
votes

I couldn't find information on what happens with a service fabric actor during upgrade of the application and deploying a new code package for that actor.

There is some saved state that I want to modify for each actor, but I'm not sure what happens during the upgrade - is there some method that is always called, that i can use like an upgrade hook?

1

1 Answers

1
votes

An ActorService is an implementation of a StatefulServiceBase (same base from a StatefulService), so the same lifecycle of a stateful service applies to the actor service.

ActorService upgrade works exactly the same way as an StatefulService, it also has a Replica Lifecycle, when the primary replica is upgraded, a secondary is promoted to primary and the primary is demoted to secondary, this happens in the event OnChangeRoleAsync and you can override it in the ActorService to handle special cases.