qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	kwolf@redhat.com, xuquan8@huawei.com, xiecl.fnst@cn.fujitsu.com,
	zhangchen.fnst@cn.fujitsu.com, qemu-block@nongnu.org,
	wencongyang2@huawei.com, qemu-devel@nongnu.org,
	mreitz@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3 5/6] replication: Implement block replication for shared disk case
Date: Fri, 10 Mar 2017 12:17:53 +0800	[thread overview]
Message-ID: <20170310041753.GA4589@stefanha-x1.localdomain> (raw)
In-Reply-To: <58BEC406.1050903@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 3816 bytes --]

On Tue, Mar 07, 2017 at 10:30:30PM +0800, Hailiang Zhang wrote:
> Hi Stefan,
> 
> Sorry for the delayed reply.
> 
> On 2017/2/28 1:37, Stefan Hajnoczi wrote:
> > On Fri, Jan 20, 2017 at 11:47:59AM +0800, zhanghailiang wrote:
> > > Just as the scenario of non-shared disk block replication,
> > > we are going to implement block replication from many basic
> > > blocks that are already in QEMU.
> > > The architecture is:
> > > 
> > >           virtio-blk                     ||                               .----------
> > >               /                          ||                               | Secondary
> > >              /                           ||                               '----------
> > >             /                            ||                                 virtio-blk
> > >            /                             ||                                      |
> > >            |                             ||                               replication(5)
> > >            |                    NBD  -------->   NBD   (2)                       |
> > >            |                  client     ||    server ---> hidden disk <-- active disk(4)
> > >            |                     ^       ||                      |
> > >            |              replication(1) ||                      |
> > >            |                     |       ||                      |
> > >            |   +-----------------'       ||                      |
> > >           (3)  |drive-backup sync=none   ||                      |
> > > --------. |   +-----------------+       ||                      |
> > > Primary | |                     |       ||           backing    |
> > > --------' |                     |       ||                      |
> > >            V                     |                               |
> > >         +-------------------------------------------+            |
> > >         |               shared disk                 | <----------+
> > >         +-------------------------------------------+
> > > 
> > >      1) Primary writes will read original data and forward it to Secondary
> > >         QEMU.
> > >      2) The hidden-disk is created automatically. It buffers the original content
> > >         that is modified by the primary VM. It should also be an empty disk, and
> > >         the driver supports bdrv_make_empty() and backing file.
> > >      3) Primary write requests will be written to Shared disk.
> > >      4) Secondary write requests will be buffered in the active disk and it
> > >         will overwrite the existing sector content in the buffer.
> > > 
> > > Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> > > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> > > Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
> > 
> > Are there any restrictions on the shared disk?  For example the -drive
> > cache= mode must be 'none'.  If the cache mode isn't 'none' the
> > secondary host might have old data in the host page cache.  The
> 
> While do checkpoint, we will call vm_stop(), in which, the bdrv_flush_all()
> will be called, is it enough ?
> 
> > Secondary QEMU would have an inconsistent view of the shared disk.
> > 
> > Are image file formats like qcow2 supported for the shared disk?  Extra
> 
> In the above scenario, it has no limitation of formats for the shared disk.
> 
> > steps are required to achieve consistency, see bdrv_invalidate_cache().
> > 
> 
> Hmm, in that case, we should call bdrv_invalidate_cache_all() while checkpoint.

Yes, it's not enough to just call bdrv_drain_all()/bdrv_flush_all().
The Secondary may need to reread metadata that is loaded in memory (e.g.
qcow2's L2 table cache) so bdrv_invalidate_cache() is needed.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-03-10  4:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20  3:47 [Qemu-devel] [PATCH v3 0/6] COLO block replication supports shared disk case zhanghailiang
2017-01-20  3:47 ` [Qemu-devel] [PATCH v3 1/6] docs/block-replication: Add description for shared-disk case zhanghailiang
2017-02-27 16:46   ` Stefan Hajnoczi
2017-03-01  3:09     ` Hailiang Zhang
2017-03-01 10:22       ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-01-20  3:47 ` [Qemu-devel] [PATCH v3 2/6] replication: add shared-disk and shared-disk-id options zhanghailiang
2017-02-27 17:10   ` Stefan Hajnoczi
2017-03-01  3:53     ` Hailiang Zhang
2017-03-01 10:21       ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-01-20  3:47 ` [Qemu-devel] [PATCH v3 3/6] replication: Split out backup_do_checkpoint() from secondary_do_checkpoint() zhanghailiang
2017-01-20  3:47 ` [Qemu-devel] [PATCH v3 4/6] replication: fix code logic with the new shared_disk option zhanghailiang
2017-01-20  3:47 ` [Qemu-devel] [PATCH v3 5/6] replication: Implement block replication for shared disk case zhanghailiang
2017-02-27 17:37   ` Stefan Hajnoczi
2017-03-07 14:30     ` Hailiang Zhang
2017-03-10  4:17       ` Stefan Hajnoczi [this message]
2017-01-20  3:48 ` [Qemu-devel] [PATCH v3 6/6] nbd/replication: implement .bdrv_get_info() for nbd and replication driver zhanghailiang
2017-02-23 12:46 ` [Qemu-devel] [PATCH v3 0/6] COLO block replication supports shared disk case Hailiang Zhang

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=20170310041753.GA4589@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wencongyang2@huawei.com \
    --cc=xiecl.fnst@cn.fujitsu.com \
    --cc=xuquan8@huawei.com \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhangchen.fnst@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).