add incremental backup support

To support incremental backups (where not all chunks are sent to the
server), a new parameter "reuse-csum" is introduced on the
"create_fixed_index" API call. When set and equal to last backups'
checksum, the backup writer clones the data from the last index of this
archive file, and only updates chunks it actually receives.

In incremental mode some checks usually done on closing an index cannot
be made, since they would be inaccurate.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter authored and Dietmar Maurer committed 2020-06-24 10:01:25 +02:00
1 parent 21302088de
commit facd9801cf
3 files changed
+71 -17

No files matched your search

+12
View File
@@ -467,6 +467,18 @@ impl FixedIndexWriter {
Ok(())
}
pub fn clone_data_from(&mut self, reader: &FixedIndexReader) -> Result<(), Error> {
if self.index_length != reader.index_count() {
bail!("clone_data_from failed - index sizes not equal");
}
for i in 0..self.index_length {
self.add_digest(i, reader.index_digest(i).unwrap())?;
}
Ok(())
}
}
pub struct BufferedFixedReader<S> {