[pbs-devel] [PATCH proxmox-backup v4 4/9] verify: move chunk loading into parallel handler
Nicolas Frey
n.frey at proxmox.com
Thu Nov 13 10:31:13 CET 2025
This way, the chunks will be loaded in parallel in addition to being
checked in parallel.
Depending on the underlying storage, this can speed up reading chunks
from disk, especially when the underlying storage is IO depth
dependent, and the CPU is faster than the storage.
Originally-by: Dominik Csapak <d.csapak at proxmox.com>
Signed-off-by: Nicolas Frey <n.frey at proxmox.com>
---
src/backup/verify.rs | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/src/backup/verify.rs b/src/backup/verify.rs
index e1eda039..07d51dcf 100644
--- a/src/backup/verify.rs
+++ b/src/backup/verify.rs
@@ -177,6 +177,20 @@ impl VerifyWorker {
.datastore
.get_chunks_in_order(&*index, skip_chunk, check_abort)?;
+ let reader_pool = ParallelHandler::new("read chunks", 1, {
+ let decoder_pool = decoder_pool.channel();
+ let verify_state = Arc::clone(&verify_state);
+ let backend = self.backend.clone();
+
+ move |info: ChunkReadInfo| {
+ Self::verify_chunk_by_backend(
+ &backend,
+ Arc::clone(&verify_state),
+ &decoder_pool,
+ &info,
+ )
+ }
+ });
for (pos, _) in chunk_list {
self.worker.check_abort()?;
self.worker.fail_on_shutdown()?;
@@ -188,15 +202,10 @@ impl VerifyWorker {
continue; // already verified or marked corrupt
}
- Self::verify_chunk_by_backend(
- &self.backend,
- Arc::clone(&verify_state),
- &decoder_pool.channel(),
- &info,
- )?;
+ reader_pool.send(info)?;
}
- decoder_pool.complete()?;
+ reader_pool.complete()?;
let elapsed = verify_state.start_time.elapsed().as_secs_f64();
--
2.47.3
More information about the pbs-devel
mailing list