Browse Source

compact: also fix segments hints data for lost segment files

The code used to remove the missing segment only from "compact" hints,
but we need to also remove it from "segments" hints.
Thomas Waldmann 1 week ago
parent
commit
32946a9f81
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/borg/repository.py

+ 2 - 1
src/borg/repository.py

@@ -808,7 +808,8 @@ class Repository:
         for segment, freeable_space in sorted(self.compact.items()):
             if not self.io.segment_exists(segment):
                 logger.warning('segment %d not found, but listed in compaction data', segment)
-                del self.compact[segment]
+                self.compact.pop(segment, None)
+                self.segments.pop(segment, None)
                 pi.show()
                 continue
             segment_size = self.io.segment_size(segment)