2
0
Эх сурвалжийг харах

transfer: create a chunks list entry for missing chunks, see #9208

Thomas Waldmann 4 өдөр өмнө
parent
commit
b43c3adabb

+ 5 - 1
src/borg/archiver/transfer_cmd.py

@@ -10,6 +10,7 @@ from ..helpers import Error
 from ..helpers import location_validator, Location, archivename_validator, comment_validator
 from ..helpers import format_file_size, bin_to_hex
 from ..helpers import ChunkerParams, ChunkIteratorFileWrapper
+from ..item import ChunkListEntry
 from ..manifest import Manifest
 from ..legacyrepository import LegacyRepository
 from ..repository import Repository
@@ -84,7 +85,10 @@ def transfer_chunks(
                         # A missing correct chunk in other_repository (source) will result in
                         # a missing chunk in repository (destination).
                         # We do NOT want to transfer all-zero replacement chunks from Borg 1 repositories.
-                        pass
+                        # But we want to have a correct chunks list entry. That will be useful in case the
+                        # chunk reappears, and also we could dynamically generate an all-zero replacement
+                        # of the correct size for reading / extracting, if desired.
+                        chunk_entry = ChunkListEntry(chunk_id, size)
                     else:
                         if recompress == "never":
                             # Keep the compressed payload the same; verify via assert_id (that will