Skip to content

Commit

Permalink
Merge pull request #7904 from ThomasWaldmann/fix-shadow-index2-1.2
Browse files Browse the repository at this point in the history
shadow index: add more comments
  • Loading branch information
ThomasWaldmann authored Nov 5, 2023
2 parents a13504c + 2a2b750 commit 21d67b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/borg/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def __init__(self, path, create=False, exclusive=False, lock_wait=None, lock=Tru
# segment_n PUT A, segment_x DELETE A
# After the "DELETE A" in segment_x the shadow index will contain "A -> [n]".
# .delete() is updating this index, it is persisted into "hints" file and is later used by .compact_segments().
# We need the entries in the shadow_index to not accidentally drop the "DELETE A" when we compact segment_x
# only (and we do not compact segment_n), because DELETE A is still needed then because PUT A will be still
# there. Otherwise chunk A would reappear although it was previously deleted.
self.shadow_index = {}
self._active_txn = False
self.lock_wait = lock_wait
Expand Down

0 comments on commit 21d67b8

Please sign in to comment.