[pve-devel] [RFC v2 0/3] Add job transaction support for backup

Stefan Reiter s.reiter at proxmox.com
Tue Aug 25 15:15:35 CEST 2020


Still RFC and experimental, though with more (successful) testing since v1.

Our backup starts one QEMU block job per drive that is included in the final
archive. Currently, we start them all in 'paused' state, manually calling
job_start for the next one we whenever one calls its completion callback.

By using a transaction, we can automate that part, meaning we need a lot less
code in pve-backup.c. Additionally, we gain the benefit of having transactional
backups, which is important for dirty-bitmaps, since it allows us to keep all
bitmaps even when a backup fails or is aborted. QEMU does the heavy lifting
here, by already having support for transactions in backup jobs and handling the
bitmaps accordingly.

A small change to the job transaction API of QEMU is necessary (patch 2) to
allow the jobs to run in sequence, instead of all at once. This property is good
to have for several reasons, like not overloading a server, writing VMA files in
sequential order and supporting bandwidth limiting (which only works per job in
QEMU).

v2:
* revert/remove existing 'PVE-Backup: modify job api'


qemu: Stefan Reiter (3):
  Revert "PVE-Backup: modify job api"
  PVE: Add sequential job transaction support
  PVE-Backup: Use a transaction to synchronize job states

 block/backup.c            |   3 -
 block/replication.c       |   2 +-
 blockdev.c                |   3 +-
 include/block/block_int.h |   1 -
 include/qemu/job.h        |  12 +++
 job.c                     |  26 +++++-
 pve-backup.c              | 169 +++++++++++---------------------------
 7 files changed, 89 insertions(+), 127 deletions(-)

-- 
2.20.1





More information about the pve-devel mailing list