public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 qemu-server 1/4] migration: avoid crash with heavy IO on local VM disk
Date: Wed, 3 Jul 2024 15:49:01 +0200	[thread overview]
Message-ID: <bbb41403-72bf-4c30-8b38-4bb320746924@proxmox.com> (raw)
In-Reply-To: <e9611a48-ce67-4beb-87a6-200dfaa434fd@proxmox.com>

Am 03.07.24 um 15:44 schrieb Fiona Ebner:
> Am 03.07.24 um 15:15 schrieb Fabian Grünbichler:
>> On May 28, 2024 10:50 am, Fiona Ebner wrote:
>>> +	eval {
>>> +	    mon_cmd(
>>> +		$vmid,
>>> +		"block-job-change",
>>> +		id => $job,
>>> +		type => 'mirror',
>>> +		'copy-mode' => 'write-blocking',
>>> +	    );
>>> +	    $switching->{$job} = 1;
>>> +	};
>>> +	die "could not switch mirror job $job to active mode - $@\n" if $@;
>>> +    }
>>> +
>>> +    while (1) {
>>> +	my $stats = mon_cmd($vmid, "query-block-jobs");
>>> +
>>> +	my $running_jobs = {};
>>> +	$running_jobs->{$_->{device}} = $_ for $stats->@*;
>>> +
>>> +	for my $job (sort keys $switching->%*) {
>>> +	    if ($running_jobs->{$job}->{'actively-synced'}) {
>>> +		print "$job: successfully switched to actively synced mode\n";
>>> +		delete $switching->{$job};
>>> +	    }
>>> +	}
>>> +
>>> +	last if scalar(keys $switching->%*) == 0;
>>> +
>>> +	sleep 1;
>>> +    }
>>
>> so what could be the cause here for a job not switching? and do we
>> really want to loop forever if it happens?
>>
> 
> That should never happen. The 'block-job-change' QMP command already
> succeeded. That means further writes will be done synchronously to the
> target. Once the remaining dirty parts have been mirrored by the
> background iteration, the actively-synced flag will be set and we break
> out of the loop.
> 
> We got to the ready condition already before doing the switch, getting
> there again is even easier after the switch:
> https://gitlab.com/qemu-project/qemu/-/blob/stable-9.0/block/mirror.c?ref_type=heads#L1078
> 

Well, "should". If a job fails after switching, then we'd actually be
stuck. Will write a v2 that is robust against that.


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

      reply	other threads:[~2024-07-03 13:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28  8:50 Fiona Ebner
2024-05-28  8:50 ` [pve-devel] [PATCH v2 qemu-server 2/4] migration: handle replication: remove outdated and inaccurate check for QEMU version Fiona Ebner
2024-07-03 13:10   ` [pve-devel] applied: " Fabian Grünbichler
2024-05-28  8:50 ` [pve-devel] [PATCH v2 qemu-server 3/4] backup: prepare: remove outdated QEMU version check Fiona Ebner
2024-07-03 13:10   ` [pve-devel] applied: " Fabian Grünbichler
2024-05-28  8:50 ` [pve-devel] [RFC v2 qemu-server 4/4] move helper to check running QEMU version out of the 'Machine' module Fiona Ebner
2024-07-03 13:32   ` Fabian Grünbichler
2024-07-03 13:15 ` [pve-devel] [PATCH v2 qemu-server 1/4] migration: avoid crash with heavy IO on local VM disk Fabian Grünbichler
2024-07-03 13:44   ` Fiona Ebner
2024-07-03 13:49     ` Fiona Ebner [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=bbb41403-72bf-4c30-8b38-4bb320746924@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=f.gruenbichler@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