public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map
@ 2021-07-13  9:23 Stefan Reiter
  2021-07-13  9:23 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] fix #3515: file-restore-daemon: allow LVs/PVs with dash in name Stefan Reiter
  2021-07-13 10:08 ` [pbs-devel] applied: [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map Dietmar Maurer
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Reiter @ 2021-07-13  9:23 UTC (permalink / raw)
  To: pbs-devel

This lock is held during VM startup, so that multiple calls will not
start VMs twice. But this means that the timeout needs to incorporate
the time it might take a VM to boot, so increase it quite a bit.

This could previously lead to "interrupted system call" errors when
accessing backups with many disks.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---

v2: unchanged

 src/bin/proxmox_file_restore/block_driver_qemu.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/proxmox_file_restore/block_driver_qemu.rs b/src/bin/proxmox_file_restore/block_driver_qemu.rs
index 24f62796..46d91198 100644
--- a/src/bin/proxmox_file_restore/block_driver_qemu.rs
+++ b/src/bin/proxmox_file_restore/block_driver_qemu.rs
@@ -50,7 +50,7 @@ impl VMStateMap {
     /// Acquire a lock on the state map and retrieve a deserialized version
     fn load() -> Result<Self, Error> {
         let mut file = Self::open_file_raw(true)?;
-        lock_file(&mut file, true, Some(std::time::Duration::from_secs(5)))?;
+        lock_file(&mut file, true, Some(std::time::Duration::from_secs(120)))?;
         let map = serde_json::from_reader(&file).unwrap_or_default();
         Ok(Self { map, file })
     }
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] [PATCH v2 proxmox-backup 2/2] fix #3515: file-restore-daemon: allow LVs/PVs with dash in name
  2021-07-13  9:23 [pbs-devel] [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map Stefan Reiter
@ 2021-07-13  9:23 ` Stefan Reiter
  2021-07-13 10:08   ` [pbs-devel] applied: " Dietmar Maurer
  2021-07-13 10:08 ` [pbs-devel] applied: [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map Dietmar Maurer
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Reiter @ 2021-07-13  9:23 UTC (permalink / raw)
  To: pbs-devel

LVM replaces any dashes '-' in an LV or PV name with two '--' for the
created device node in /dev/mapper/ to distinguish the seperating
character between the PV and LV name.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---

v2: replace in VG name too of course... as usual realized that right after
sending v1

 src/bin/proxmox_restore_daemon/disk.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/bin/proxmox_restore_daemon/disk.rs b/src/bin/proxmox_restore_daemon/disk.rs
index 1bcfc798..57ca8d7c 100644
--- a/src/bin/proxmox_restore_daemon/disk.rs
+++ b/src/bin/proxmox_restore_daemon/disk.rs
@@ -308,7 +308,11 @@ impl Filesystems {
                 let mntpath = format!("/mnt/lvm/{}/{}", &data.vg_name, &data.lv_name);
                 create_dir_all(&mntpath)?;
 
-                let mapper_path = format!("/dev/mapper/{}-{}", &data.vg_name, &data.lv_name);
+                let mapper_path = format!(
+                    "/dev/mapper/{}-{}",
+                    &data.vg_name.replace('-', "--"),
+                    &data.lv_name.replace('-', "--")
+                );
                 self.try_mount(&mapper_path, &mntpath)?;
 
                 let mp = PathBuf::from(mntpath);
-- 
2.30.2





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] applied: [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map
  2021-07-13  9:23 [pbs-devel] [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map Stefan Reiter
  2021-07-13  9:23 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] fix #3515: file-restore-daemon: allow LVs/PVs with dash in name Stefan Reiter
@ 2021-07-13 10:08 ` Dietmar Maurer
  1 sibling, 0 replies; 4+ messages in thread
From: Dietmar Maurer @ 2021-07-13 10:08 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stefan Reiter

applied

On 7/13/21 11:23 AM, Stefan Reiter wrote:
> This lock is held during VM startup, so that multiple calls will not
> start VMs twice. But this means that the timeout needs to incorporate
> the time it might take a VM to boot, so increase it quite a bit.
>
> This could previously lead to "interrupted system call" errors when
> accessing backups with many disks.
>
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>
> v2: unchanged
>
>   src/bin/proxmox_file_restore/block_driver_qemu.rs | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/bin/proxmox_file_restore/block_driver_qemu.rs b/src/bin/proxmox_file_restore/block_driver_qemu.rs
> index 24f62796..46d91198 100644
> --- a/src/bin/proxmox_file_restore/block_driver_qemu.rs
> +++ b/src/bin/proxmox_file_restore/block_driver_qemu.rs
> @@ -50,7 +50,7 @@ impl VMStateMap {
>       /// Acquire a lock on the state map and retrieve a deserialized version
>       fn load() -> Result<Self, Error> {
>           let mut file = Self::open_file_raw(true)?;
> -        lock_file(&mut file, true, Some(std::time::Duration::from_secs(5)))?;
> +        lock_file(&mut file, true, Some(std::time::Duration::from_secs(120)))?;
>           let map = serde_json::from_reader(&file).unwrap_or_default();
>           Ok(Self { map, file })
>       }




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pbs-devel] applied: [PATCH v2 proxmox-backup 2/2] fix #3515: file-restore-daemon: allow LVs/PVs with dash in name
  2021-07-13  9:23 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] fix #3515: file-restore-daemon: allow LVs/PVs with dash in name Stefan Reiter
@ 2021-07-13 10:08   ` Dietmar Maurer
  0 siblings, 0 replies; 4+ messages in thread
From: Dietmar Maurer @ 2021-07-13 10:08 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Stefan Reiter

applied

On 7/13/21 11:23 AM, Stefan Reiter wrote:
> LVM replaces any dashes '-' in an LV or PV name with two '--' for the
> created device node in /dev/mapper/ to distinguish the seperating
> character between the PV and LV name.
>
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>
> v2: replace in VG name too of course... as usual realized that right after
> sending v1
>
>   src/bin/proxmox_restore_daemon/disk.rs | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/proxmox_restore_daemon/disk.rs b/src/bin/proxmox_restore_daemon/disk.rs
> index 1bcfc798..57ca8d7c 100644
> --- a/src/bin/proxmox_restore_daemon/disk.rs
> +++ b/src/bin/proxmox_restore_daemon/disk.rs
> @@ -308,7 +308,11 @@ impl Filesystems {
>                   let mntpath = format!("/mnt/lvm/{}/{}", &data.vg_name, &data.lv_name);
>                   create_dir_all(&mntpath)?;
>   
> -                let mapper_path = format!("/dev/mapper/{}-{}", &data.vg_name, &data.lv_name);
> +                let mapper_path = format!(
> +                    "/dev/mapper/{}-{}",
> +                    &data.vg_name.replace('-', "--"),
> +                    &data.lv_name.replace('-', "--")
> +                );
>                   self.try_mount(&mapper_path, &mntpath)?;
>   
>                   let mp = PathBuf::from(mntpath);




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-13 10:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  9:23 [pbs-devel] [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map Stefan Reiter
2021-07-13  9:23 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] fix #3515: file-restore-daemon: allow LVs/PVs with dash in name Stefan Reiter
2021-07-13 10:08   ` [pbs-devel] applied: " Dietmar Maurer
2021-07-13 10:08 ` [pbs-devel] applied: [PATCH v2 proxmox-backup 1/2] file-restore: increase lock timeout on QEMU map Dietmar Maurer

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