1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-03 21:56:44 +00:00

add debug logging for repository cleanup

so we can know whether it did a cleanup and if so,
which and how many segments were cleaned up.

(cherry picked from commit 57f808e4bb)
This commit is contained in:
Thomas Waldmann 2017-08-31 22:49:30 +02:00
parent 6d0b4c3e09
commit 9ca490ad5e

View file

@ -1172,11 +1172,15 @@ def cleanup(self, transaction_id):
"""Delete segment files left by aborted transactions
"""
self.segment = transaction_id + 1
count = 0
for segment, filename in self.segment_iterator(reverse=True):
if segment > transaction_id:
truncate_and_unlink(filename)
count += 1
else:
break
logger.debug('Cleaned up %d uncommitted segment files (== everything after segment %d).',
count, transaction_id)
def is_committed_segment(self, segment):
"""Check if segment ends with a COMMIT_TAG tag