-
Notifications
You must be signed in to change notification settings - Fork 292
Change receive_start2
to multiplex on the local SR type
#6434
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
Change receive_start2
to multiplex on the local SR type
#6434
Conversation
c696d49
to
0dd313b
Compare
@@ -569,6 +569,14 @@ module MIRROR : SMAPIv2_MIRROR = struct | |||
Storage_migrate_helper.get_remote_backend url verify_dest | |||
in | |||
match remote_mirror with | |||
| Mirror.QCOW2_mirror _ -> | |||
(* this should never happen *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may not be the case if @gthvn1 gets away with it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of the mirror is based on the SMAPI version reported by each storage backend (although they are currently hardcoded). So I don't think this will be an issue unless one changes the way mirroring is done in SMAPIv1... Feel free to modify this code in the future if needed though
reiceve_start2
to multiplex on the local SR typereceive_start2
to multiplex on the local SR type
|
||
(* SMAPIv3 mirror operation *) | ||
type operation = | ||
| CopyV1 of copy_operation_v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the v's are getting confusing... But this seems to be defined in xapi-storage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't follow all the details, particularly in the final commit, but broadly speaking this is moving things in the right direction. Quite extensive testing is needed before merging though.
ead92ee
to
efd1036
Compare
raise | ||
(Storage_error | ||
(Migration_mirror_failure | ||
"Incorrect remote mirror format for SMAPIv1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could more information be included to help diagnosis when this happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a "this should never happen" branch and is only there to make the compiler happy... I don't think user should encounter this error in any case, and there is probably nothing they can do about it if they do for some reason...
Luckily we have a new SXM functional tests suite, which I am running to test for regressions. Looks good so far |
These will be used when mirroring a VDI that is on a SMAPIv3 SR. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
Adding a few more states that will be tracked by the send_state and receive_state. These will be used later on for SMAPIv3 outbound migration. We do need to give them a default value in case the deserialisation of the on-disk copy does not have these values. These are not used yet, so no functional change. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
These functions will not be exposed in storage_migrate.ml any more. `receive_start` is kept in the mux for backwards compatability reasons, and will go straight to the SMAPIv1 implemenetation. `receive_start2` calls will not be directed to the storage_mux any more, instead it will be multiplexed by the new layer in storage_migrate. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
Previously `MIRROR.receive_start2` is called as a remote function, i.e. `Remote.DATA.MIRROR.receive_start2` and it will be forwarded to the destination host and multiplexes based on the destination SR type. This is inconvenient as what `receive_start2` should do is more dependent on what the source SR type is. For example, if the source SR is using SMAPIv1, then `receive_start2` needs to tell the destination host to create snapshots VDIs, while this is not necessary if the source SR type is of SMAPIv3. Hence instead of calling `Remote.receive_start2`, call each individual functions inside `receive_start2` remotely, such as `Remote.VDI.create`, and these SMAPIv2 functions will still be multiplexed on the destiantion side, based on the destination SR type. And this is indeed what we want, imagine a case where we are migrating v1 -> v3, what we want is still create a snapshot VDI, but on the v3 SR. This does mean that the state tracking, such as `State.add`, which was previously tracked by the destination host, now needs to be tracked by the source host. And this will affect a number of other `receive_` functions such as `receive_finalize2` and `receive_cancel2`, which are updated accordingly. For backwards compatability reasons, we still need to preserve `receive_start` which might still be called from an older host trying to do a v1 -> v1 migration. And this is done by making sure that the SMAPIv2 done inside `receive_start` are all local, while the `receive_start` call itself is remote. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
efd1036
to
8da184b
Compare
Test LGTM, merge! |
Continuation of #6434, more mutiplexing for SXM, this time the mirror status checking logic. No functional change. More to come...
Continuing on #6423
This PR changes the way
receive_start2
is called, and it can now multiplex based on the source SR and destination SR type.Note that
receive_start2
is introduced for inbound SXM for SMAPIv3, which is flagged off by default, so no need to worry about backwards compatability.Also introduces a couple of new types for SMAPIv3 migration, but they are uncurrently unused.
There should still be no functional change.
More to come...