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:44:30 +0200	[thread overview]
Message-ID: <e9611a48-ce67-4beb-87a6-200dfaa434fd@proxmox.com> (raw)
In-Reply-To: <1720012217.r27ketiaun.astroid@yuna.none>

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


_______________________________________________
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:44 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 [this message]
2024-07-03 13:49     ` Fiona Ebner

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=e9611a48-ce67-4beb-87a6-200dfaa434fd@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