|
@@ -738,7 +738,7 @@ class Repository:
|
|
|
if not self.compact:
|
|
|
logger.debug('nothing to do: compact empty')
|
|
|
return
|
|
|
- freed_space = 0
|
|
|
+ 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
|
|
@@ -778,7 +778,6 @@ class Repository:
|
|
|
segment, freeable_ratio * 100.0, freeable_space)
|
|
|
pi.show()
|
|
|
continue
|
|
|
- freed_space += freeable_space # this is what we THINK we can free
|
|
|
segments.setdefault(segment, 0)
|
|
|
logger.debug('compacting segment %d with usage count %d (freeable: %2.2f%% [%d bytes])',
|
|
|
segment, segments[segment], freeable_ratio * 100.0, freeable_space)
|
|
@@ -867,7 +866,8 @@ class Repository:
|
|
|
pi.show()
|
|
|
pi.finish()
|
|
|
complete_xfer(intermediate=False)
|
|
|
- logger.info('compaction freed about %s repository space.', format_file_size(freed_space))
|
|
|
+ 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):
|