mirror of https://github.com/borgbackup/borg.git
recreate: fix crash if recompress and deduplication beyond autocommit_threshold
ie. it means that if all the recompressed chunks were already in the repo no data would be written, so there would be no active txn, so failure ensues.
This commit is contained in:
parent
e60ed80433
commit
e4e6787906
|
@ -1450,7 +1450,7 @@ class ArchiveRecreater:
|
||||||
chunk_id, size, csize = self.cache.add_chunk(chunk_id, chunk, target.stats, overwrite=overwrite)
|
chunk_id, size, csize = self.cache.add_chunk(chunk_id, chunk, target.stats, overwrite=overwrite)
|
||||||
new_chunks.append((chunk_id, size, csize))
|
new_chunks.append((chunk_id, size, csize))
|
||||||
self.seen_chunks.add(chunk_id)
|
self.seen_chunks.add(chunk_id)
|
||||||
if self.recompress:
|
if self.recompress and self.cache.seen_chunk(chunk_id) == 1:
|
||||||
# This tracks how many bytes are uncommitted but compactable, since we are recompressing
|
# This tracks how many bytes are uncommitted but compactable, since we are recompressing
|
||||||
# existing chunks.
|
# existing chunks.
|
||||||
target.recreate_uncomitted_bytes += csize
|
target.recreate_uncomitted_bytes += csize
|
||||||
|
|
Loading…
Reference in New Issue