public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Leo Nunner <l.nunner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 storage] fix #3004: show progress of offline migration in task log
Date: Thu, 31 Aug 2023 11:00:17 +0200	[thread overview]
Message-ID: <fd223f06-fc7e-f63b-6301-bc5be57e4bb3@proxmox.com> (raw)
In-Reply-To: <fb3e343a-f4b3-535f-2f6a-aad92c341407@proxmox.com>

Thanks for the review!

On 2023-08-30 10:22, Fiona Ebner wrote:
> Sorry about the late review!
>
> Am 16.11.22 um 12:02 schrieb Leo Nunner:
>> --- a/PVE/Storage.pm
>> +++ b/PVE/Storage.pm
> Needs a rebase, because files got moved to src/
>
>> @@ -821,12 +821,25 @@ sub storage_migrate {
>>  
>>      my $new_volid;
>>      my $pattern = volume_imported_message(undef, 1);
>> -    my $match_volid_and_log = sub {
>> +    # Matches new volid and rate-limits dd output
>> +    my $match_and_log = sub {
> Why rename the function?
>
>>  	my $line = shift;
>> +	my $show = 1;
>> +
>> +	# rate-limit dd logs
>> +	if ($line =~ /(?:\d+ bytes)(?:.+?copied, )(\d+) s/) {
>> +	    if ($1 < 60) { # if < 60s, print every 3s
>> +		$show = !($1 % 3);
>> +	    } elsif($1 < 600) { # if < 10mins, print every 10s
> Style nit: missing space after elsif
>
>> +		$show = !($1 % 10);
>> +	    } else { # else, print every 30s
>> +		$show = !($1 % 30);
>> +	    }
>> +	}
ack, I'll fix those things in the v2.
> Upon completion something strange happens: There's a duplicate final log
> with fractional seconds and duplicate records in/out.

The duplicate logs seem to happen already without my patch:

> 2023-08-31 10:38:54 found local disk
> 'cluster-dir:100/vm-100-disk-0.raw' (attached)
> 2023-08-31 10:38:54 copying local disk images
> 2023-08-31 10:38:56 Formatting
> '/mnt/dir/images/100/vm-100-disk-0.raw', fmt=raw size=2147483648
> preallocation=off
> 2023-08-31 10:39:02 524288+0 records in
> 2023-08-31 10:39:02 524288+0 records out
> 2023-08-31 10:39:02 2147483648 bytes (2.1 GB, 2.0 GiB) copied, 6.52443
> s, 329 MB/s
> 2023-08-31 10:39:02 16749+32053 records in
> 2023-08-31 10:39:02 16749+32053 records out
> 2023-08-31 10:39:02 2147483648 bytes (2.1 GB, 2.0 GiB) copied, 6.22392
> s, 345 MB/s
> 2023-08-31 10:39:02 successfully imported
> 'cluster-dir:100/vm-100-disk-0.raw'
> 2023-08-31 10:39:02 volume 'cluster-dir:100/vm-100-disk-0.raw' is
> 'cluster-dir:100/vm-100-disk-0.raw' on the target
> 2023-08-31 10:39:03 migration finished successfully (duration 00:00:09)
> TASK OK

So this might be something that could be fixed in a separate, future patch.





      reply	other threads:[~2023-08-31  9:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 11:02 Leo Nunner
2023-08-30  8:22 ` Fiona Ebner
2023-08-31  9:00   ` Leo Nunner [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=fd223f06-fc7e-f63b-6301-bc5be57e4bb3@proxmox.com \
    --to=l.nunner@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