Skip to content

Commit

Permalink
Merge pull request #8516 from ThomasWaldmann/fix-compress-entry
Browse files Browse the repository at this point in the history
compress_entry: fix assertion failure
  • Loading branch information
ThomasWaldmann authored Nov 2, 2024
2 parents 59459af + 0545b6a commit bef9595
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/borg/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,10 @@ def compress_entry(self, entry):
cie = self.chunks.get(id)
assert cie is not None
assert cie.flags & ChunkIndex.F_USED
assert size == cie.size
if cie.size == 0: # size is not known in the chunks index yet
self.chunks[id] = cie._replace(size=size)
else:
assert size == cie.size, f"{size} != {cie.size}"
idx = self.chunks.k_to_idx(id)
compressed_chunks.append(idx)
entry = entry._replace(chunks=compressed_chunks)
Expand Down

0 comments on commit bef9595

Please sign in to comment.