From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] api: config: fix push sync jobs cleanup on datastore destroy
Date: Wed, 17 Dec 2025 10:51:13 +0100 [thread overview]
Message-ID: <20251217095113.210083-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20251217095113.210083-1-c.ebner@proxmox.com>
Since list_config_sync_jobs() defaults to sync direction pull if no
explicit direction is provided, push sync jobs are not cleaned up on
datastore destruction.
The default was set to pull direction intentionally in commit
403ad1f6 ("api: admin: sync: add optional 'all' sync type for
listing") to avoid possible issues with clients reading and updating
sync job configs via the API. It was then however incorrectly adapted
with commit 4b76b731 ("api: admin/config: introduce sync direction as
job config parameter").
Fix this by explicitley setting the sync direction to
`ListSyncDirection::All` when listing sync jobs for removal.
Fixes: 4b76b731 ("api: admin/config: introduce sync direction as job config parameter")
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/config/datastore.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index d9005694d..f845fe2d0 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -24,7 +24,7 @@ use pbs_datastore::chunk_store::ChunkStore;
use crate::api2::admin::datastore::do_mount_device;
use crate::api2::admin::prune::list_prune_jobs;
-use crate::api2::admin::sync::list_config_sync_jobs;
+use crate::api2::admin::sync::{list_config_sync_jobs, ListSyncDirection};
use crate::api2::admin::verify::list_verification_jobs;
use crate::api2::config::prune::{delete_prune_job, do_create_prune_job, has_prune_job};
use crate::api2::config::sync::delete_sync_job;
@@ -724,7 +724,12 @@ pub async fn delete_datastore(
for job in list_verification_jobs(Some(name.clone()), Value::Null, rpcenv)? {
delete_verification_job(job.config.id, None, rpcenv)?
}
- for job in list_config_sync_jobs(Some(name.clone()), None, Value::Null, rpcenv)? {
+ for job in list_config_sync_jobs(
+ Some(name.clone()),
+ Some(ListSyncDirection::All),
+ Value::Null,
+ rpcenv,
+ )? {
delete_sync_job(job.config.id, None, rpcenv)?
}
for job in list_prune_jobs(Some(name.clone()), Value::Null, rpcenv)? {
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-12-17 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 9:51 [pbs-devel] [PATCH proxmox-backup 0/2] fix removal of push sync jobs on Christian Ebner
2025-12-17 9:51 ` [pbs-devel] [PATCH proxmox-backup 1/2] api: config: split imports per module to be on individual lines Christian Ebner
2025-12-17 9:51 ` Christian Ebner [this message]
2025-12-17 16:02 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] fix removal of push sync jobs on Thomas Lamprecht
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=20251217095113.210083-3-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.