[pbs-devel] [PATCH proxmox-backup v2 05/12] local store cache: serve response fetched from s3 backend
Christian Ebner
c.ebner at proxmox.com
Wed Oct 8 17:21:18 CEST 2025
If the chunk file was not found in the local datastore cache or the
chunk file was the zero marker, it is fetched from the s3 backend and
re-inserted.
Currently, the chunk is then re-read from the file, but that is not
required. Serve the still in-memory chunk data as result of the cacher
access call.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
pbs-datastore/src/local_datastore_lru_cache.rs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pbs-datastore/src/local_datastore_lru_cache.rs b/pbs-datastore/src/local_datastore_lru_cache.rs
index fe0b336ff..7d0b3e114 100644
--- a/pbs-datastore/src/local_datastore_lru_cache.rs
+++ b/pbs-datastore/src/local_datastore_lru_cache.rs
@@ -124,7 +124,7 @@ impl LocalDatastoreLruCache {
let bytes = response.content.collect().await?.to_bytes();
let chunk = DataBlob::from_raw(bytes.to_vec())?;
self.store.insert_chunk(&chunk, digest)?;
- std::fs::File::open(&path)?
+ return Ok(Some(chunk));
}
}
} else {
@@ -147,8 +147,7 @@ impl LocalDatastoreLruCache {
let bytes = response.content.collect().await?.to_bytes();
let chunk = DataBlob::from_raw(bytes.to_vec())?;
self.store.insert_chunk(&chunk, digest)?;
- let mut file = std::fs::File::open(&path)?;
- DataBlob::load_from_reader(&mut file)?
+ return Ok(Some(chunk));
}
}
} else {
--
2.47.3
More information about the pbs-devel
mailing list