From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-storage v4 3/7] backup provider api: document repeated backup_init() calls on retries
Date: Fri, 20 Nov 2026 17:05:06 +0100 [thread overview]
Message-ID: <20261120160510.311796-4-j.klocker@proxmox.com> (raw)
In-Reply-To: <20261120160510.311796-1-j.klocker@proxmox.com>
vzdump can retry failed guest backups within the same job, depending
on the new 'error-behavior' option. As a result, backup_init() and
backup_cleanup() can be called multiple times for the same guest on
the same provider instance.
Document that providers must not carry over per-guest state from a
failed attempt.
Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
src/PVE/BackupProvider/Plugin/Base.pm | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/PVE/BackupProvider/Plugin/Base.pm b/src/PVE/BackupProvider/Plugin/Base.pm
index 9358fc6..c693db0 100644
--- a/src/PVE/BackupProvider/Plugin/Base.pm
+++ b/src/PVE/BackupProvider/Plugin/Base.pm
@@ -48,6 +48,11 @@ backup_container_prepare() call while still privileged. The actual
backup_container() call happens as the (unprivileged) container root user, so
that the file owner and group IDs match the container's perspective.
+If the backup of a guest fails, the job may retry it later, depending on the
+C<error-behavior> backup option. Each attempt goes through its own
+backup_init() to backup_cleanup() cycle on the same backup provider instance,
+so these methods can be called more than once for the same guest within a job.
+
=head3 1.1 Backup Mechanisms
VM:
@@ -254,6 +259,13 @@ C</> and colon C<:>.
Use C<$self> to remember it for the C<backup_container()> or C<backup_vm()>
method that will be called later.
+If a previous attempt for the same guest failed and the job retries it,
+C<backup_init()> is called again for that guest within the same job, after
+C<backup_cleanup()> was called with C<$success> being false. Each call starts a
+new attempt, so do not carry over per-guest state from an earlier attempt. For
+example, reset what was remembered in C<$self> for this guest, and do not base
+an incremental backup on data of the failed attempt.
+
Parameters:
=over
--
2.47.3
next prev parent reply other threads:[~2026-11-20 16:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 16:05 [PATCH docs/guest-common/manager/storage/storage-plugin-examples v4 0/7] fix #6464: backup: add backup retry strategies Jakob Klocker
2026-11-20 16:05 ` [PATCH pve-storage-plugin-examples v4 1/7] backup provider example: run proxmox-perltidy Jakob Klocker
2026-11-20 16:05 ` [PATCH pve-storage-plugin-examples v4 2/7] backup provider example: reset per-guest state in backup_init Jakob Klocker
2026-11-20 16:05 ` Jakob Klocker [this message]
2026-11-20 16:05 ` [PATCH pve-guest-common v4 4/7] vzdump: add error-behavior and max-retries options Jakob Klocker
2026-11-20 16:05 ` [PATCH pve-manager v4 5/7] fix #6464: vzdump: add retry strategies for failed guest backups Jakob Klocker
2026-11-20 16:05 ` [PATCH pve-manager v4 6/7] ui: backup: add error behavior and retry options Jakob Klocker
2026-11-20 16:05 ` [PATCH pve-docs v4 7/7] vzdump: document backup " Jakob Klocker
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=20261120160510.311796-4-j.klocker@proxmox.com \
--to=j.klocker@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