Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove multi-activation grains from Catalog and ActivationDirectory #7231

Merged

Conversation

ReubenBond
Copy link
Member

This PR removes multiple activation concepts from the Catalog/'ActivationDirectory` as part of #6880.
To do that, I needed some way to deal with the last remaining "multi-activation" thing in our system: stateless worker grains.

To allow [StatelessWorker] grains to be represented by a single activation in the Catalog/ActivationDirectory, I added a new class, StatelessWorkerGrainContext, which implements IGrainContext for grains marked as [StatelessWorker].
Since a stateless worker can have multiple activations with the same grain id, StatelessWorkerGrainContext manages a collection of regular ActivationData instances and delegates message handling to them.

  • ActivationCollector now relies on ICollectibleGrainContext, rather than referencing ActivationData directly.
  • Properties on ActivationData which are common to all activations of a particular grain type were moved into GrainTypeSharedContext. This reduces the weight of each activation and makes it easier to implement StatelessWorkerGrainContext since it can delegate common functionality to that shared class.
  • Orients ActivationDirectory around a GrainId to IGrainContext mapping, rather than ActivationId to ActivationData (which had additional collections to map GrainId). All notion of multiple activations per GrainId was removed from ActivationDirectory.
  • Message.IsNewPlacement was removed, since it's no longer necessary.

The purpose is to:

  • Generalize IGrainContext further in useful ways, so that other implementations can be added for different scenarios
  • Further the work required to remove multiple-activation support so that we can remove the need for ActivationId (Remove ActivationId #6880)

@ReubenBond ReubenBond force-pushed the feature/statelessworker-graincontext branch 6 times, most recently from 2614da2 to 7db36c5 Compare August 27, 2021 13:22
@ReubenBond ReubenBond force-pushed the feature/statelessworker-graincontext branch from 7db36c5 to 38cb459 Compare August 27, 2021 17:32
@ReubenBond ReubenBond merged commit ad64ffb into dotnet:main Aug 27, 2021
@ReubenBond ReubenBond deleted the feature/statelessworker-graincontext branch August 27, 2021 22:23
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant