[pbs-devel] [PATCH 0/2] use async pxar encoder

Stefan Reiter s.reiter at proxmox.com
Tue Feb 9 13:03:46 CET 2021


No change in functionality intended for these two patches, but they will be
needed for my upcoming file-restore series. (or, well, they avoid doing the same
sync-but-in-thread style we follow in PxarBackupStream right now)

Changes the pxar archive creation code to fully embracy async/await and the
aio::Encoder from the pxar crate. Requires some changes in both crates, to
ensure 'SeqWrite + Send' is properly supported.

Testing and benchmarking showed no real difference in behaviour, except for a
very slight slowdown when backing up a folder with many smaller files (I tested
on my local QEMU repo, that's 11.2 GiB of git indices and data/code files atm).
This may be attributable to the introduced Mutex locking, or async/await
overhead - or just a fluke on my machine. 17s without, 19s with the patches.

Folders with fewer, but bigger files are unaffected.

Certainly learned a lot of Rust from this :) Lifetimes are still hard to follow
IMHO, especially with async... Feedback is appreciated of course, if there's
anything that can be done better.


pxar: Stefan Reiter (1):
  make aio::Encoder actually behave with async

 src/encoder/aio.rs  |  48 ++++++++---------
 src/encoder/mod.rs  | 128 +++++++++++++++++++++++---------------------
 src/encoder/sync.rs |  28 ++++------
 3 files changed, 101 insertions(+), 103 deletions(-)

proxmox-backup: Stefan Reiter (1):
  asyncify pxar create_archive

 src/bin/pxar.rs                  |   6 +-
 src/client/pxar_backup_stream.rs |  65 +++++-----
 src/pxar/create.rs               | 207 ++++++++++++++++---------------
 tests/catar.rs                   |   5 +-
 4 files changed, 143 insertions(+), 140 deletions(-)

-- 
2.20.1





More information about the pbs-devel mailing list