mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-22 15:57:15 +00:00
compress_entry: fix assertion failure
if the size is not known yet in the chunks index, we must update the value there.
This commit is contained in:
parent
59459af88b
commit
0545b6a2eb
1 changed files with 4 additions and 1 deletions
|
@ -397,7 +397,10 @@ def compress_entry(self, entry):
|
||||||
cie = self.chunks.get(id)
|
cie = self.chunks.get(id)
|
||||||
assert cie is not None
|
assert cie is not None
|
||||||
assert cie.flags & ChunkIndex.F_USED
|
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)
|
idx = self.chunks.k_to_idx(id)
|
||||||
compressed_chunks.append(idx)
|
compressed_chunks.append(idx)
|
||||||
entry = entry._replace(chunks=compressed_chunks)
|
entry = entry._replace(chunks=compressed_chunks)
|
||||||
|
|
Loading…
Reference in a new issue