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).
This commit is contained in:
Thomas Waldmann 2023-10-28 17:17:47 +02:00
parent 8e6449f28e
commit b21ed3c658
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 1 additions and 4 deletions

View File

@ -1224,10 +1224,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, segment, offset, update_shadow_index=False)
self._delete(id, segment, offset, update_shadow_index=True)
segment, offset = self.io.write_put(id, data)
self.storage_quota_use += len(data) + self.io.put_header_fmt.size
self.segments.setdefault(segment, 0)