public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 0/2] fix removal of push sync jobs on
@ 2025-12-17  9:51 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
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Christian Ebner @ 2025-12-17  9:51 UTC (permalink / raw)
  To: pbs-devel

Fix an issue were push sync jobs are not removed on datastore
destruction by explicitley list all sync jobs from the config, not
just the ones with default pull direction. While at it, improve
code style for use statements as well by splitting them based on
modules.

Christian Ebner (2):
  api: config: split imports per module to be on individual lines
  api: config: fix push sync jobs cleanup on datastore destroy

 src/api2/config/datastore.rs | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

-- 
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 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

* [pbs-devel] applied: [PATCH proxmox-backup 0/2] fix removal of push sync jobs on
  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 ` [pbs-devel] [PATCH proxmox-backup 2/2] api: config: fix push sync jobs cleanup on datastore destroy Christian Ebner
@ 2025-12-17 16:02 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2025-12-17 16:02 UTC (permalink / raw)
  To: pbs-devel, Christian Ebner

On Wed, 17 Dec 2025 10:51:11 +0100, Christian Ebner wrote:
> Fix an issue were push sync jobs are not removed on datastore
> destruction by explicitley list all sync jobs from the config, not
> just the ones with default pull direction. While at it, improve
> code style for use statements as well by splitting them based on
> modules.
> 
> Christian Ebner (2):
>   api: config: split imports per module to be on individual lines
>   api: config: fix push sync jobs cleanup on datastore destroy
> 
> [...]

Applied, thanks!

[1/2] api: config: split imports per module to be on individual lines
      commit: 0c4b234c64a1b6663598d6e853393539c198cf4e
[2/2] api: config: fix push sync jobs cleanup on datastore destroy
      commit: 4bbfdeb5e61be804e02270bba949546789bdcf45


_______________________________________________
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

end of thread, other threads:[~2025-12-17 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [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

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