From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 5B87C1FF165 for ; Thu, 31 Jul 2025 11:15:12 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2D92236BAC; Thu, 31 Jul 2025 11:16:39 +0200 (CEST) Message-ID: Date: Thu, 31 Jul 2025 11:16:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Friedrich Weber To: Proxmox VE development discussion , Fiona Ebner References: <20250731090956.23443-1-f.ebner@proxmox.com> Content-Language: en-US In-Reply-To: <20250731090956.23443-1-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753953353657 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.011 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH qemu-server] block job: mirror: always detach the target node upon cancelling X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On 31/07/2025 11:09, Fiona Ebner wrote: > This is a further improvement after commit 8e671e79 ("block job: > mirror: always detach the target node upon error"). It might be > that a cancelled job ends up in concluded state without an error > being set in the result of the 'query-block-jobs' QMP command and > the target node would not be detached. To fix it, also detach the > target node when cancelling the job. This is correct even when the job > was cancelled after completion, as in that case, the drive is not > switched over to use the target node. > > Reported-by: Friedrich Weber > Signed-off-by: Fiona Ebner > --- Thanks for the patch! Seems to fix my reproducer: Without this patch (`opt` being a directory storage): # qm stop 101; qm destroy 101; qm create 101 --scsi0 local-lvm:1; qm start 101; timeout 1 qm disk move 101 scsi0 opt; qm disk move 101 scsi0 opt Logical volume "vm-101-disk-0" successfully removed. Logical volume "vm-101-disk-0" created. Logical volume pve/vm-101-disk-0 changed. scsi0: successfully created disk 'local-lvm:vm-101-disk-0,size=1G' create full clone of drive scsi0 (local-lvm:vm-101-disk-0) Formatting '/opt/images/101/vm-101-disk-0.raw', fmt=raw size=1073741824 preallocation=off drive mirror is starting for drive-scsi0 mirror-scsi0: transferred 85.0 MiB of 1.0 GiB (8.30%) in 0s mirror-scsi0: Cancelling block job mirror-scsi0: Done. storage migration failed: block job (mirror) error: interrupted by signal create full clone of drive scsi0 (local-lvm:vm-101-disk-0) Formatting '/opt/images/101/vm-101-disk-0.raw', fmt=raw size=1073741824 preallocation=off storage migration failed: adding blockdev 'zc34a13b971104aab98614370f1a40f' failed : VM 101 qmp command 'blockdev-add' failed - Duplicate nodes with node-name='zc34a13b971104aab98614370f1a40f' With this patch: # qm stop 101; qm destroy 101; qm create 101 --scsi0 local-lvm:1; qm start 101; timeout 1 qm disk move 101 scsi0 opt; qm disk move 101 scsi0 opt Logical volume "vm-101-disk-0" successfully removed. Logical volume "vm-101-disk-0" created. Logical volume pve/vm-101-disk-0 changed. scsi0: successfully created disk 'local-lvm:vm-101-disk-0,size=1G' create full clone of drive scsi0 (local-lvm:vm-101-disk-0) Formatting '/opt/images/101/vm-101-disk-0.raw', fmt=raw size=1073741824 preallocation=off drive mirror is starting for drive-scsi0 mirror-scsi0: transferred 142.0 MiB of 1.0 GiB (13.87%) in 0s mirror-scsi0: Cancelling block job mirror-scsi0: Done. storage migration failed: block job (mirror) error: interrupted by signal create full clone of drive scsi0 (local-lvm:vm-101-disk-0) Formatting '/opt/images/101/vm-101-disk-0.raw', fmt=raw size=1073741824 preallocation=off drive mirror is starting for drive-scsi0 mirror-scsi0: transferred 13.0 MiB of 1.0 GiB (1.27%) in 0s mirror-scsi0: transferred 1.0 GiB of 1.0 GiB (100.00%) in 1s, ready all 'mirror' jobs are ready mirror-scsi0: Completing block job... mirror-scsi0: Completed successfully. mirror-scsi0: mirror-job finished So consider this Tested-by: Friedrich Weber _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel