From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Hongyang Yang <yanghy@cn.fujitsu.com>,
Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 3/3] libxc/migrationv2: Split {start, end}_of_stream() to make checkpoint variants
Date: Mon, 11 May 2015 10:02:29 +0100 [thread overview]
Message-ID: <55507025.1080309@citrix.com> (raw)
In-Reply-To: <5550147B.1010304@cn.fujitsu.com>
On 11/05/15 03:31, Hongyang Yang wrote:
> On 05/08/2015 09:30 PM, Ian Campbell wrote:
>> On Fri, 2015-05-08 at 13:54 +0100, Andrew Cooper wrote:
>>> This is in preparation for supporting checkpointed streams in
>>> migration v2.
>>> - For PV guests, the VCPU context is moved to end_of_checkpoint().
>>> - For HVM guests, the HVM context and params are moved to
>>> end_of_checkpoint().
>>
>> [...]
>>> + /**
>>> + * Send records which need to be at the end of the checkpoint.
>>> This is
>>> + * called once, or once per checkpoint in a checkpointed
>>> stream, and is
>>> + * after the memory data.
>>> + */
>>> + int (*end_of_checkpoint)(struct xc_sr_context *ctx);
>>> +
>>> + /**
>>> + * Send records which need to be at the end of the stream.
>>> This is called
>>> + * once, before the END record is written.
>>> */
>>> int (*end_of_stream)(struct xc_sr_context *ctx);
>> [...]
>>> +static int x86_hvm_end_of_stream(struct xc_sr_context *ctx)
>>> +{
>>> + int rc;
>>> +
>>> + rc = write_tsc_info(ctx);
>>> if ( rc )
>>> return rc;
>>>
>>> - /* Write HVM_PARAMS record contains applicable HVM params. */
>>> - rc = write_hvm_params(ctx);
>>> +#ifdef XG_LIBXL_HVM_COMPAT
>>> + rc = write_toolstack(ctx);
>>
>> I'm not sure about this end_of_stream thing. In a check pointing for
>> fault tolerance scenario (Remus or COLO) then failover happens when the
>> sender has died for some reason, and therefore won't get the chance to
>> send any end of stream stuff.
>>
>> IOW I think everything in end_of_stream actually needs to be in
>> end_of_checkpoint unless it is just for informational purposes in a
>> regular migration or something (which write_toolstack surely isn't)
>
> Yes, all records should be sent at every checkpoint, except those
> only need to be sent once.
>
> checkpoint:
> You can see clearly from the patches a Remus migration explicit include
> two stage, first stage is live migration, the second is Checkpointed
> stream. The live migration is obvious, after the live migration, both
> primary and secondary are in the same state, the primary will continue
> to run until the next checkpoint, at checkpint, we sync the secondary
> state with the primary, so that both side are in the same state, so
> any record that could be changed while Guest is runing should be sent
> at checkpoint.
>
> failover:
> The handling of Checkpointed stream on restore side is also include
> two stage,
> first is buffer records, second is process records. This is because if
> master
> died when sending records, the secondary state will be inconsistent.
> So we
> have to make sure all records are received and then process the records.
> If master died, the secondary can recover from the last checkpoint state.
> Currently Remus failover relies on the migration channel. If the channel
> break, we presume master is dead, so we will failover. The "goto
> err_buf" is
> the failover path, with goto err_buf, we discard the current checkpoint
> records because it is imperfect, then resume the guest with last
> checkpoint
> state(the last processed records).
Thankyou for the clarification.
It occurs to me that, despite things like 'last_iter', it is actually
the first iteration which is actually special in Remus.
Is there a case where the primary decides to explicitly hand over to the
secondary?
~Andrew
next prev parent reply other threads:[~2015-05-11 9:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 12:54 [PATCH 0/3] Misc patches to aid migration v2 Remus support Andrew Cooper
2015-05-08 12:54 ` [PATCH 1/3] [RFC] x86/hvm: Permit HVM_PARAM_IDENT_PT to be set more than once Andrew Cooper
2015-05-08 13:46 ` Jan Beulich
2015-05-08 13:48 ` Andrew Cooper
2015-05-08 12:54 ` [PATCH 2/3] tools/libxc: Properly quote macro parameters Andrew Cooper
2015-05-08 13:00 ` Andrew Cooper
2015-05-08 15:00 ` Ian Campbell
2015-05-08 13:26 ` Ian Campbell
2015-05-08 12:54 ` [PATCH 3/3] libxc/migrationv2: Split {start, end}_of_stream() to make checkpoint variants Andrew Cooper
2015-05-08 13:30 ` Ian Campbell
2015-05-08 13:37 ` Andrew Cooper
2015-05-08 13:50 ` Ian Campbell
2015-05-08 13:55 ` Andrew Cooper
2015-05-08 14:12 ` Ian Campbell
2015-05-11 2:40 ` Hongyang Yang
2015-05-11 2:31 ` Hongyang Yang
2015-05-11 9:02 ` Andrew Cooper [this message]
2015-05-11 9:23 ` Hongyang Yang
2015-05-08 13:15 ` [PATCH 0/3] Misc patches to aid migration v2 Remus support Andrew Cooper
2015-05-11 2:43 ` Hongyang Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55507025.1080309@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=yanghy@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.