From 6d9513f507a4fcbd2663b769e22ff40b181fe9c7 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 28 Oct 2023 17:17:47 +0200 Subject: [PATCH] update shadow index when doing a double-put, fixes #5661 this fixes the test added in previous commit (avoids that the PUT reappears after index rebuild). --- src/borg/repository.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/borg/repository.py b/src/borg/repository.py index 673cf7584..8f7c31e9e 100644 --- a/src/borg/repository.py +++ b/src/borg/repository.py @@ -1300,10 +1300,7 @@ class Repository: pass else: # note: doing a delete first will do some bookkeeping. - # we do not want to update the shadow_index here, because - # we know already that we will PUT to this id, so it will - # be in the repo index (and we won't need it in the shadow_index). - self._delete(id, in_index.segment, in_index.offset, in_index.size, update_shadow_index=False) + self._delete(id, in_index.segment, in_index.offset, in_index.size, update_shadow_index=True) segment, offset = self.io.write_put(id, data) self.storage_quota_use += header_size(TAG_PUT2) + len(data) self.segments.setdefault(segment, 0)