Bladeren bron

get rid of chunks_healthy when rechunking, fixes #3218

(cherry picked from commit 7211bb2211606e97eb57751a4f61a968862de0e8)
Thomas Waldmann 7 jaren geleden
bovenliggende
commit
fe74b54890
2 gewijzigde bestanden met toevoegingen van 15 en 0 verwijderingen
  1. 4 0
      src/borg/archive.py
  2. 11 0
      src/borg/archiver.py

+ 4 - 0
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:

+ 11 - 0
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__,