public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] api: backup: include previous snapshot name in log message
@ 2025-04-15  9:11 Christian Ebner
  2025-04-15 10:13 ` [pbs-devel] applied: " Wolfgang Bumiller
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2025-04-15  9:11 UTC (permalink / raw)
  To: pbs-devel

Extends the log messages written to the server's backup worker task
log to include the snapshot name which is used as previous snapshot.

This information facilitates debugging efforts, as the previous
snapshot might have been pruned since.

For example, instead of
```
download 'index.json.blob' from previous backup.
register chunks in 'drive-scsi0.img.fidx' from previous backup.
download 'drive-scsi0.img.fidx' from previous backup.
```

this now logs
```
download 'index.json.blob' from previous backup 'vm/101/2025-04-15T09:02:10Z'.
register chunks in 'drive-scsi0.img.fidx' from previous backup 'vm/101/2025-04-15T09:02:10Z'.
download 'drive-scsi0.img.fidx' from previous backup 'vm/101/2025-04-15T09:02:10Z'.
```

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
This information is of great interest when debugging issues like, e.g.
https://my.proxmox.com/en/dbsfk/ticket/view/17530

 src/api2/backup/mod.rs | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/api2/backup/mod.rs b/src/api2/backup/mod.rs
index 344c80d46..629df933e 100644
--- a/src/api2/backup/mod.rs
+++ b/src/api2/backup/mod.rs
@@ -853,8 +853,8 @@ fn download_previous(
             };
             if let Some(index) = index {
                 env.log(format!(
-                    "register chunks in '{}' from previous backup.",
-                    archive_name
+                    "register chunks in '{archive_name}' from previous backup '{}'.",
+                    last_backup.backup_dir.dir(),
                 ));
 
                 for pos in 0..index.index_count() {
@@ -865,7 +865,10 @@ fn download_previous(
             }
         }
 
-        env.log(format!("download '{}' from previous backup.", archive_name));
+        env.log(format!(
+            "download '{archive_name}' from previous backup '{}'.",
+            last_backup.backup_dir.dir(),
+        ));
         crate::api2::helpers::create_download_response(path).await
     }
     .boxed()
-- 
2.39.5



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


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

* [pbs-devel] applied: [PATCH proxmox-backup] api: backup: include previous snapshot name in log message
  2025-04-15  9:11 [pbs-devel] [PATCH proxmox-backup] api: backup: include previous snapshot name in log message Christian Ebner
@ 2025-04-15 10:13 ` Wolfgang Bumiller
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Bumiller @ 2025-04-15 10:13 UTC (permalink / raw)
  To: Christian Ebner; +Cc: pbs-devel

applied, thanks

On Tue, Apr 15, 2025 at 11:11:15AM +0200, Christian Ebner wrote:
> Extends the log messages written to the server's backup worker task
> log to include the snapshot name which is used as previous snapshot.
> 
> This information facilitates debugging efforts, as the previous
> snapshot might have been pruned since.
> 
> For example, instead of
> ```
> download 'index.json.blob' from previous backup.
> register chunks in 'drive-scsi0.img.fidx' from previous backup.
> download 'drive-scsi0.img.fidx' from previous backup.
> ```
> 
> this now logs
> ```
> download 'index.json.blob' from previous backup 'vm/101/2025-04-15T09:02:10Z'.
> register chunks in 'drive-scsi0.img.fidx' from previous backup 'vm/101/2025-04-15T09:02:10Z'.
> download 'drive-scsi0.img.fidx' from previous backup 'vm/101/2025-04-15T09:02:10Z'.
> ```
> 
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
> This information is of great interest when debugging issues like, e.g.
> https://my.proxmox.com/en/dbsfk/ticket/view/17530
> 
>  src/api2/backup/mod.rs | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/api2/backup/mod.rs b/src/api2/backup/mod.rs
> index 344c80d46..629df933e 100644
> --- a/src/api2/backup/mod.rs
> +++ b/src/api2/backup/mod.rs
> @@ -853,8 +853,8 @@ fn download_previous(
>              };
>              if let Some(index) = index {
>                  env.log(format!(
> -                    "register chunks in '{}' from previous backup.",
> -                    archive_name
> +                    "register chunks in '{archive_name}' from previous backup '{}'.",
> +                    last_backup.backup_dir.dir(),
>                  ));
>  
>                  for pos in 0..index.index_count() {
> @@ -865,7 +865,10 @@ fn download_previous(
>              }
>          }
>  
> -        env.log(format!("download '{}' from previous backup.", archive_name));
> +        env.log(format!(
> +            "download '{archive_name}' from previous backup '{}'.",
> +            last_backup.backup_dir.dir(),
> +        ));
>          crate::api2::helpers::create_download_response(path).await
>      }
>      .boxed()
> -- 
> 2.39.5


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


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

end of thread, other threads:[~2025-04-15 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-15  9:11 [pbs-devel] [PATCH proxmox-backup] api: backup: include previous snapshot name in log message Christian Ebner
2025-04-15 10:13 ` [pbs-devel] applied: " Wolfgang Bumiller

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