소스 검색

compact: derive freed space from quota use before/after, fixes #5679

due to the way quota accounting is done, this is likely not
100% precise, but much better than selling the hints as the truth.

Backport notes: 1.1 did not report how much space was freed so
I have added the message.
Thomas Waldmann 3 년 전
부모
커밋
57475f4b72
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/borg/repository.py

+ 3 - 0
src/borg/repository.py

@@ -725,6 +725,7 @@ class Repository:
         """
         if not self.compact:
             return
+        quota_use_before = self.storage_quota_use
         index_transaction_id = self.get_index_transaction_id()
         segments = self.segments
         unused = []  # list of segments, that are not used anymore
@@ -847,6 +848,8 @@ class Repository:
             pi.show()
         pi.finish()
         complete_xfer(intermediate=False)
+        quota_use_after = self.storage_quota_use
+        logger.info('compaction freed about %s repository space.', format_file_size(quota_use_before - quota_use_after))
         logger.debug('compaction completed.')
 
     def replay_segments(self, index_transaction_id, segments_transaction_id):