fix: allow local activation migration#10218
Draft
ReubenBond wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes activation migration behavior when placement selects the current silo by deferring the “local handoff” until after the old activation is removed from the local catalog, preventing deadlocks/skipped migration flow. Also updates migration docs to reflect that same-silo placement is a valid migration destination and adds a regression test.
Changes:
- Allow
ActivationMigrationManagerto accept same-silo migration requests directly. - Update deactivation/migration flow to dehydrate first, unregister the old activation from the local catalog, then complete migration for same-silo handoffs.
- Add a regression test which forces migration back to the current silo and validates state preservation across the new activation.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.DefaultCluster.Tests/Migration/MigrationTests.cs | Adds a regression test for same-silo activation migration and state preservation. |
| src/Orleans.Runtime/Catalog/ActivationMigrationManager.cs | Allows same-silo migration by directly invoking AcceptMigratingGrains. |
| src/Orleans.Runtime/Catalog/ActivationData.cs | Defers same-silo migration completion until after UnregisterMessageTarget() removes the old activation from the catalog. |
| src/Orleans.Core.Abstractions/Core/Internal/IGrainManagementExtension.cs | Updates XML docs to not imply migration requires a new location. |
| src/Orleans.Core.Abstractions/Core/IGrainBase.cs | Updates XML docs to describe migration destination selection more accurately. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 1
Comment on lines
+132
to
+136
| do | ||
| { | ||
| cts.Token.ThrowIfCancellationRequested(); | ||
| newAddress = await grain.GetGrainAddress(); | ||
| } while (newAddress.ActivationId == originalAddress.ActivationId); |
Ensure activation migration to the local silo still follows the normal dehydrate/rehydrate flow while deferring the local handoff until after the old activation is removed from the catalog. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0a3cd12 to
0eba386
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Activation migration could deadlock or skip the regular flow when placement selected the local silo, because the replacement activation could not be created until the old activation was removed from the local catalog.
This change lets migration to the local silo still dehydrate first, then defers the local handoff until after
UnregisterMessageTarget()removes the old activation from the catalog. The migration manager accepts same-silo handoffs directly, and the migration APIs/docs no longer imply that same-silo placement is ignored.A regression test forces migration back to the current silo and verifies that a new activation is created on the same silo with migrated state preserved.
Microsoft Reviewers: Open in CodeFlow