* [pbs-devel] [PATCH proxmox-backup 1/2] api: config: split imports per module to be on individual lines
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 ` Christian Ebner
2025-12-17 9:51 ` [pbs-devel] [PATCH proxmox-backup 2/2] api: config: fix push sync jobs cleanup on datastore destroy Christian Ebner
2025-12-17 16:02 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] fix removal of push sync jobs on Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2025-12-17 9:51 UTC (permalink / raw)
To: pbs-devel
By splitting the use statement into individual ones the diffs in
future changes become more digestable and follows the style used
throughout the rest of the codebase more closely.
No functional changes.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/config/datastore.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index ec7ca0e33..d9005694d 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -22,10 +22,10 @@ use pbs_api_types::{
use pbs_config::BackupLockGuard;
use pbs_datastore::chunk_store::ChunkStore;
-use crate::api2::admin::{
- datastore::do_mount_device, prune::list_prune_jobs, sync::list_config_sync_jobs,
- verify::list_verification_jobs,
-};
+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::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;
use crate::api2::config::tape_backup_job::{delete_tape_backup_job, list_tape_backup_jobs};
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* [pbs-devel] [PATCH proxmox-backup 2/2] api: config: fix push sync jobs cleanup on datastore destroy
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
2025-12-17 16:02 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] fix removal of push sync jobs on Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Christian Ebner @ 2025-12-17 9:51 UTC (permalink / raw)
To: pbs-devel
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
^ permalink raw reply [flat|nested] 4+ messages in thread