mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 01:06:50 +00:00
Merge pull request #5009 from ThomasWaldmann/fix-commit-freespace-calc-missing-segment-file-master
commit-time free space calc: ignore bad compact map entries, fixes #4796
This commit is contained in:
commit
6520fa2bb7
1 changed files with 7 additions and 1 deletions
|
@ -669,7 +669,13 @@ def check_free_space(self):
|
||||||
if len(self.compact) < 10:
|
if len(self.compact) < 10:
|
||||||
# This is mostly for the test suite to avoid overestimated free space needs. This can be annoying
|
# This is mostly for the test suite to avoid overestimated free space needs. This can be annoying
|
||||||
# if TMP is a small-ish tmpfs.
|
# if TMP is a small-ish tmpfs.
|
||||||
compact_working_space = sum(self.io.segment_size(segment) - free for segment, free in self.compact.items())
|
compact_working_space = 0
|
||||||
|
for segment, free in self.compact.items():
|
||||||
|
try:
|
||||||
|
compact_working_space += self.io.segment_size(segment) - free
|
||||||
|
except FileNotFoundError:
|
||||||
|
# looks like self.compact is referring to a non-existent segment file, ignore it.
|
||||||
|
pass
|
||||||
logger.debug('check_free_space: few segments, not requiring a full free segment')
|
logger.debug('check_free_space: few segments, not requiring a full free segment')
|
||||||
compact_working_space = min(compact_working_space, full_segment_size)
|
compact_working_space = min(compact_working_space, full_segment_size)
|
||||||
logger.debug('check_free_space: calculated working space for compact as %d bytes', compact_working_space)
|
logger.debug('check_free_space: calculated working space for compact as %d bytes', compact_working_space)
|
||||||
|
|
Loading…
Reference in a new issue