From fe74b54890350fb3725202cf359814f50b24d685 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 29 Oct 2017 10:53:12 +0100 Subject: [PATCH] get rid of chunks_healthy when rechunking, fixes #3218 (cherry picked from commit 7211bb2211606e97eb57751a4f61a968862de0e8) --- src/borg/archive.py | 4 ++++ src/borg/archiver.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/borg/archive.py b/src/borg/archive.py index 577fa8e64..1c8a1332e 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -917,6 +917,10 @@ Utilization of max. archive size: {csize_max:.0%} return chunk_entry item.chunks = [] + # if we rechunkify, we'll get a fundamentally different chunks list, thus we need + # to get rid of .chunks_healthy, as it might not correspond to .chunks any more. + if getattr(self, 'recreate_rechunkify', False) and 'chunks_healthy' in item: + del item.chunks_healthy from_chunk = 0 part_number = 1 for data in chunk_iter: diff --git a/src/borg/archiver.py b/src/borg/archiver.py index d978ec107..588350a8e 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -3563,6 +3563,17 @@ class Archiver: deduplicated size of the archives using the previous chunker params. When recompressing expect approx. (throughput / checkpoint-interval) in space usage, assuming all chunks are recompressed. + + If you recently ran borg check --repair and it had to fix lost chunks with all-zero + replacement chunks, please first run another backup for the same data and re-run + borg check --repair afterwards to heal any archives that had lost chunks which are + still generated from the input data. + + Important: running borg recreate to re-chunk will remove the chunks_healthy + metadata of all items with replacement chunks, so healing will not be possible + any more after re-chunking (it is also unlikely it would ever work: due to the + change of chunking parameters, the missing chunk likely will never be seen again + even if you still have the data that produced it). """) subparser = subparsers.add_parser('recreate', parents=[common_parser], add_help=False, description=self.do_recreate.__doc__,