From 663d3c544a3d2c7c74e3b30b282d9c02bc869aaa Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 22 Jul 2017 20:12:41 +0200 Subject: [PATCH] chunk_incref size assertion: fail early --- src/borg/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/borg/cache.py b/src/borg/cache.py index 520e66a9d..e343ac745 100644 --- a/src/borg/cache.py +++ b/src/borg/cache.py @@ -1002,10 +1002,10 @@ Chunk index: {0.total_unique_chunks:20d} unknown""" if not self._txn_active: self._begin_txn() count, size, csize = self.chunks.incref(id) - stats.update(size or size_, csize, False) # When size is 0 and size_ is not given, then this chunk has not been locally visited yet (seen_chunk with # size or add_chunk); we can't add references to those (size=0 is invalid) and generally don't try to. assert size or size_ + stats.update(size or size_, csize, False) return ChunkListEntry(id, size or size_, csize) def chunk_decref(self, id, stats, wait=True):