[pbs-devel] [PATCH proxmox-backup] client: backup writer: make no-cache parameter backwards compatible

Christian Ebner c.ebner at proxmox.com
Wed Jul 23 13:50:15 CEST 2025


Commit 90723828 ("api: backup: add no-cache flag to bypass local
datastore cache") introduced the additional flag to request bypassing
of the datastore cache by the Proxmox Backup Server.

The flag is however included in the backup api request parameters,
which is incompatible with older version of the server.

Fix this by only setting the flag if requested explicitley on
invocation, as it is then not included for requests to older servers
and for newer the default is to set this to false if not present
anyways.

Fixes: 90723828 ("api: backup: add no-cache flag to bypass local datastore cache")
Reported-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-client/src/backup_writer.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pbs-client/src/backup_writer.rs b/pbs-client/src/backup_writer.rs
index abe7c79e2..9f62baba3 100644
--- a/pbs-client/src/backup_writer.rs
+++ b/pbs-client/src/backup_writer.rs
@@ -102,8 +102,10 @@ impl BackupWriter {
             "store": writer_options.datastore,
             "debug": writer_options.debug,
             "benchmark": writer_options.benchmark,
-            "no-cache": writer_options.no_cache,
         });
+        if writer_options.no_cache {
+            param["no-cache"] = serde_json::to_value(writer_options.no_cache)?;
+        }
 
         if !writer_options.ns.is_root() {
             param["ns"] = serde_json::to_value(writer_options.ns)?;
-- 
2.47.2





More information about the pbs-devel mailing list