mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-09 21:57:24 +00:00
check --repair: recreate shadow index, see #6687
before this fix, borg check --repair just created an empty shadow index, which can lead to incomplete entries if entries are added later. and such incomplete (but present) entries can lead to compact_segments() resurrecting old PUTs by accidentally dropping related DELs.
This commit is contained in:
parent
48feb28e11
commit
a7809429b3
1 changed files with 2 additions and 0 deletions
|
@ -917,6 +917,7 @@ class Repository:
|
|||
s, _ = self.index[key]
|
||||
self.compact[s] += size
|
||||
self.segments[s] -= 1
|
||||
self.shadow_index.setdefault(key, []).append(s)
|
||||
except KeyError:
|
||||
pass
|
||||
self.index[key] = segment, offset
|
||||
|
@ -935,6 +936,7 @@ class Repository:
|
|||
self.segments[s] -= 1
|
||||
size = self.io.read(s, offset, key, read_data=False)
|
||||
self.compact[s] += size
|
||||
self.shadow_index.setdefault(key, []).append(s)
|
||||
elif tag == TAG_COMMIT:
|
||||
continue
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue