Skip to content

CP-49249: Implement SMAPIv3 CBT Forwarding #5675

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

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

contificate
Copy link
Contributor

These changes populate the stubs in xapi-storage-script with the logic required for forwarding CBT-related functionality to xapi-storage-plugins. Specifically, it will enable changed block tracking between snapshot VDIs whose storage substrate is XFS (local) or GFS2 (pool-wide).

This functionality has been tested and looks to be working (the primary logic is on the storage plugins side, not ours). This set of changes shouldn't cause any breakage as the SMAPIv3 plugins are meant to be guarded to not advertise this capability to XAPI.

The style of the changes is up for discussion. I'm not fond of much of the style in xapi-storage-script; it nests monads in awkward ways (the kind of ways that motivate monad transformers in a language like Haskell) with undocumented details (e.g. Attached_SRs ensures an SR's UUID string gets mapped to somewhere, typically /run/sr-mount/... - otherwise the associated python plugins can't resolve them). Furthermore, the changes predate OCaml's addition of let-operators, so it's all very much infix monadic bind >>= everywhere. I don't like infix @@ usage generally, as in my current commit, but it is a good visual marker.

All that said: I'd rather not play more type tetris where it's unnecessary.
There exists another branch by psafont that cleans up a lot of xapi-storage-script, so I'd push for those kind of sweeping changes in the long run rather than make isolated syntax changes ad nauseam.

This PR also includes relevant lifecycle updates from previous stuff, so if any fixup commits are pushed on top, a selective squash should be done to preserve that history (no github merge strategies). Or, we could make a separate PR for the lifecycle change, then I'll rebase this onto the new master.

Colin James added 2 commits June 5, 2024 10:36
Signed-off-by: Colin James <colin.barr@cloud.com>
Implements the changes required to forward CBT-related functionality to the
SMAPIv3 storage plugins, which now support CBT for XFS and GFS2 storage
repositories.

The length of the changed blocks requested is hardcoded as a negative number,
which is interpreted by the related plugins as requesting the changes for the
entire length of the VDIs being compared. SMAPIv1 does not support this
functionality but we retain it here with this behaviour in case we want to make
the functionality explicit in future.

Signed-off-by: Colin James <colin.barr@cloud.com>
@contificate contificate marked this pull request as ready for review June 5, 2024 12:59
Copy link
Member

@robhoes robhoes left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@contificate contificate merged commit e802010 into xapi-project:master Jun 6, 2024
13 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.

3 participants