mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 01:37:20 +00:00
fix updating shadow_index also in put
The shadow_index should be in same state after both of these sequences (let's assume that A is not in repo yet for simplicity, but it does not matter): a) explicit delete: put(A), delete(A), put(A), resulting in: PUT A, DEL A, PUT A repo contents b) implicit delete: put(A), put(A), resulting in: PUT A, DEL A, PUT A repo contents
This commit is contained in:
parent
5f32b5666a
commit
f079a83fed
1 changed files with 1 additions and 1 deletions
|
@ -1216,11 +1216,11 @@ def delete(self, id, wait=True):
|
|||
segment, offset = self.index.pop(id)
|
||||
except KeyError:
|
||||
raise self.ObjectNotFound(id, self.path) from None
|
||||
self.shadow_index.setdefault(id, []).append(segment)
|
||||
self._delete(id, segment, offset)
|
||||
|
||||
def _delete(self, id, segment, offset):
|
||||
# common code used by put and delete
|
||||
self.shadow_index.setdefault(id, []).append(segment)
|
||||
self.segments[segment] -= 1
|
||||
size = self.io.read(segment, offset, id, read_data=False)
|
||||
self.storage_quota_use -= size
|
||||
|
|
Loading…
Reference in a new issue