public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Fiona Ebner <f.ebner@proxmox.com>
Subject: [pve-devel] applied-series: [PATCH v3 qemu-server 1/2] migration: avoid crash with heavy IO on local VM disk
Date: Tue, 30 Jul 2024 21:25:03 +0200	[thread overview]
Message-ID: <98f6bdf1-c546-429e-97d4-fe22d60318b6@proxmox.com> (raw)
In-Reply-To: <20240704093212.27136-1-f.ebner@proxmox.com>

Am 04/07/2024 um 11:32 schrieb Fiona Ebner:
> There is a possibility that the drive-mirror job is not yet done when
> the migration wants to inactivate the source's blockdrives:
> 
>> bdrv_co_write_req_prepare: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed.
> 
> This can be prevented by using the 'write-blocking' copy mode (also
> called active mode) for the mirror. However, with active mode, the
> guest write speed is limited by the synchronous writes to the mirror
> target. For this reason, a way to start out in the faster 'background'
> mode and later switch to active mode was introduced in QEMU 8.2.
> 
> The switch is done once the mirror job for all drives is ready to be
> completed to reduce the time spent where guest IO is limited.
> 
> The loop waiting for actively-synced to become true is not an endless
> loop: Once the remaining dirty parts have been mirrored by the
> background iteration, the actively-synced flag will be set. Because
> the 'block-job-change' QMP command already succeeded, new writes will
> be done synchronously to the target and thus not lead to new dirty
> parts. If the job fails or vanishes (shouldn't actually happen,
> because auto-dismiss is false), the loop will be exited and the error
> propagated.
> 
> Reported rarely, but steadily over the years:
> https://forum.proxmox.com/threads/78954/post-353651
> https://forum.proxmox.com/threads/78954/post-380015
> https://forum.proxmox.com/threads/100020/post-431660
> https://forum.proxmox.com/threads/111831/post-482425
> https://forum.proxmox.com/threads/111831/post-499807
> https://forum.proxmox.com/threads/137849/
> 
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> 
> Changes in v3:
>     * avoid endless loop when job fails while switching to active mode
>     * mention rationale why loop is not and endless loop in commit
>       message
> 
>  PVE/QemuMigrate.pm                    |  8 +++++
>  PVE/QemuServer.pm                     | 51 +++++++++++++++++++++++++++
>  test/MigrationTest/QemuMigrateMock.pm |  6 ++++
>  3 files changed, 65 insertions(+)
> 
>

applied both patches, thanks!

Albeit I'm a bit wondering if we would be able to mock at a deeper level than, e.g.,
qemu_drive_mirror_switch_to_active_mode, maybe by mocking mon_cmd and then also
checking if they monitor commands are triggered as expected and in the correct order.
But that might affect a few more methods and definitively orthogonal to this.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      parent reply	other threads:[~2024-07-30 19:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04  9:32 [pve-devel] " Fiona Ebner
2024-07-04  9:32 ` [pve-devel] [PATCH v3 qemu-server 2/2] move helper to check running QEMU version out of the 'Machine' module Fiona Ebner
2024-07-30 19:25 ` Thomas Lamprecht [this message]

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=98f6bdf1-c546-429e-97d4-fe22d60318b6@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal