qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
	qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, armbru@redhat.com, eblake@redhat.com,
	hreitz@redhat.com, kwolf@redhat.com, jsnow@redhat.com,
	f.gruenbichler@proxmox.com, t.lamprecht@proxmox.com,
	mahaocong@didichuxing.com
Subject: Re: [RFC 0/4] mirror: implement incremental and bitmap modes
Date: Thu, 29 Feb 2024 13:47:26 +0100	[thread overview]
Message-ID: <0a3b3d62-5374-4219-a5fa-f087f93d85d8@proxmox.com> (raw)
In-Reply-To: <b737130a-2a01-4b1c-945a-b0d574345d0e@yandex-team.ru>

Am 29.02.24 um 12:48 schrieb Vladimir Sementsov-Ogievskiy:
> On 29.02.24 13:11, Fiona Ebner wrote:
>>
>> The iotest creates a new target image for each incremental sync which
>> only records the diff relative to the previous mirror and those diff
>> images are later rebased onto each other to get the full picture.
>>
>> Thus, it can be that a previous mirror job (not just background process
>> or previous write) already copied a cluster, and in particular, copied
>> it to a different target!
> 
> Aha understand.
> 
> For simplicity, let's consider case, when source "cluster size" = "job
> cluster size" = "bitmap granularity" = "target cluster size".
> 
> Which types of clusters we should consider, when we want to handle guest
> write?
> 
> 1. Clusters, that should be copied by background process
> 
> These are dirty clusters from user-given bitmap, or if we do a full-disk
> mirror, all clusters, not yet copied by background process.
> 
> For such clusters we simply ignore the unaligned write. We can even
> ignore the aligned write too: less disturbing the guest by delays.
> 

Since do_sync_target_write() currently doesn't ignore aligned writes, I
wouldn't change it. Of course they can count towards the "done_bitmap"
you propose below.

> 2. Clusters, already copied by background process during this mirror job
> and not dirtied by guest since this time.
> 
> For such clusters we are safe to do unaligned write, as target cluster
> must be allocated.
> 

Right.

> 3. Clusters, not marked initially by dirty bitmap.
> 
> What to do with them? We can't do unaligned write. I see two variants:
> 
> - do additional read from source, to fill the whole cluster, which seems
> a bit too heavy
> 

Yes, I'd rather only do that as a last resort.

> - just mark the cluster as dirty for background job. So we behave like
> in "background" mode. But why not? The maximum count of such "hacks" is
> limited to number of "clear" clusters at start of mirror job, which
> means that we don't seriously affect the convergence. Mirror is
> guaranteed to converge anyway. And the whole sense of "write-blocking"
> mode is to have a guaranteed convergence. What do you think?
> 

It could lead to a lot of flips between job->actively_synced == true and
== false. AFAIU, currently, we only switch back from true to false when
an error happens. While I don't see a concrete issue with it, at least
it might be unexpected to users, so it better be documented.

I'll try going with this approach, thanks!

> 
> ----
> 
> Of course, we can't distinguish 3 types by on dirty bitmap, so we need
> the second one. For example "done_bitmap", where we can mark clusters
> that were successfully copied. That would be a kind of block-status of
> target image. But using bitmap is a lot better than querying
> block-status from target.

Best Regards,
Fiona



  reply	other threads:[~2024-02-29 12:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 10:55 [RFC 0/4] mirror: implement incremental and bitmap modes Fiona Ebner
2024-02-16 10:55 ` [RFC 1/4] drive-mirror: add support for sync=bitmap mode=never Fiona Ebner
2024-02-21  6:55   ` Markus Armbruster
2024-02-21  9:21     ` Fiona Ebner
2024-02-16 10:55 ` [RFC 2/4] drive-mirror: add support for conditional and always bitmap sync modes Fiona Ebner
2024-02-16 10:55 ` [RFC 3/4] mirror: move some checks to qmp Fiona Ebner
2024-02-16 10:55 ` [RFC 4/4] iotests: add test for bitmap mirror Fiona Ebner
2024-02-28 16:00 ` [RFC 0/4] mirror: implement incremental and bitmap modes Vladimir Sementsov-Ogievskiy
2024-02-28 16:06   ` Vladimir Sementsov-Ogievskiy
2024-02-29 10:11     ` Fiona Ebner
2024-02-29 11:48       ` Vladimir Sementsov-Ogievskiy
2024-02-29 12:47         ` Fiona Ebner [this message]
2024-03-06 13:44           ` Fiona Ebner
2024-03-07  9:20             ` Vladimir Sementsov-Ogievskiy
2024-02-28 16:24 ` Vladimir Sementsov-Ogievskiy
2024-02-29 10:41   ` Fiona Ebner
2024-02-29 12:00     ` Vladimir Sementsov-Ogievskiy
2024-02-29 14:50       ` Fiona Ebner
2024-03-01 14:14         ` Vladimir Sementsov-Ogievskiy
2024-03-01 14:52           ` Fiona Ebner
2024-03-01 15:02             ` Vladimir Sementsov-Ogievskiy
2024-03-01 15:14               ` Fiona Ebner
2024-03-01 15:46                 ` Vladimir Sementsov-Ogievskiy
2024-03-04  7:50                   ` Fiona Ebner
2024-03-04  9:02     ` Fabian Grünbichler

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=0a3b3d62-5374-4219-a5fa-f087f93d85d8@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mahaocong@didichuxing.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=t.lamprecht@proxmox.com \
    --cc=vsementsov@yandex-team.ru \
    /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).