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

Revert VM migration shutdown order change + change post_detach to post_deactivate #6260

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

Vincent-lau
Copy link
Contributor

There are two parts to this PR:

  1. Reverts the VM migration ordering change, which was previously thought to be necessary as I did not see VM_save would actually deactivate the source VM datapath. Thanks @edwintorok for pointing that out.
  2. Change post_detach_hook to post_deactivate_hook, as this should have been called as soon as the datapath is deactivated, at which point all r/w using that datapath will be stopped.

More details in the commit message.

This reverts commit 889dfa6. As there
is no need to clean up the source VM earlier at all, VM_save already
does the job of deactivating the source VM datapath.

Signed-off-by: Vincent Liu <[email protected]>
Previously the `post_detach_hook` was run after the VDI is detached on
the source VM, which is at the very end of the SXM, where the source VM
is shutdown. However, the job of `post_detach_hook` is to call
`Remote.receive_finalize` which will destroy the mirroring datapath.
This should have been called as soon as we deactivate the datapath on
the source VM, at which point the source VM will stop writing using that
datapath. This commit changes `post_detach_hook` to
`post_deactivate_hook` and moves its calling locations accordingly.

Signed-off-by: Vincent Liu <[email protected]>
@Vincent-lau Vincent-lau force-pushed the private/shul2/sxm-nodown branch from 5ed535d to 764ec0d Compare January 28, 2025 22:48
@@ -422,10 +422,10 @@ functor
| Vdi_automaton.Deactivate ->
Storage_migrate.pre_deactivate_hook ~dbg ~dp ~sr ~vdi ;
Impl.VDI.deactivate context ~dbg ~dp ~sr ~vdi ~vm ;
Storage_migrate.post_deactivate_hook ~sr ~vdi ~dp ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is SMAPIv1 only. I guess it still works for the v1 to v3 storage migration but anything migrating from SMAPIv3 would need another plan.

@robhoes robhoes added this pull request to the merge queue Jan 29, 2025
Merged via the queue into xapi-project:master with commit 4ea5d43 Jan 29, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants