2
votes

I want rename an actor service and redeploy and migrate the data to the "new" (renamed) actor.

When I only rename the actor and deploy it, it will result in this error:

Services must be explicitly deleted before removing their Service Types

Which makes sense because the name in the manifest is changed.

But what is the recommended/easiest way to rename actors and keep the data?

I can try to backup and restore the data in the new actor. But this will not fit in a CICD way of working.

Found a related question: Service Fabric: removed actors and now upgrade fails but is seems there is a lot of manual actions involved.

1

1 Answers

1
votes

I would try to deploy a version which:

  • extend the existing actors with ability to read their state
  • create the new actors - when needed - by reading the state of the existing actors and then delete the read existing actor (you realy do not need it right?)

If you do not deleteOnConverted, you double the needed storage space, to convert.

Finally deploy a version, which:

  • delete the un-converted existing actors or convert remaining existing actors into the new type
  • in the new actors - disable lookup of the existing/old actors state (this is easy to forget)

Maybe you can always throw away state in a CI-setup, while a CD-setup requires state-conversion?

BTW - You should avoid to rename state, because it is a breaking change.