compact: not "freeable", but "maybe freeable"

e.g. if there is a ton of DELs in a segment, they all are maybe freeable,
but only if we also got rid of the respective PUTs (see also #6289).
This commit is contained in:
Thomas Waldmann 2022-02-12 20:36:57 +01:00
parent e80b5c2272
commit 17e8aef394
1 changed files with 2 additions and 2 deletions

View File

@ -774,12 +774,12 @@ class Repository:
# we want to compact if:
# - we can free a considerable relative amount of space (freeable_ratio over some threshold)
if not (freeable_ratio > threshold):
logger.debug('not compacting segment %d (freeable: %2.2f%% [%d bytes])',
logger.debug('not compacting segment %d (maybe freeable: %2.2f%% [%d bytes])',
segment, freeable_ratio * 100.0, freeable_space)
pi.show()
continue
segments.setdefault(segment, 0)
logger.debug('compacting segment %d with usage count %d (freeable: %2.2f%% [%d bytes])',
logger.debug('compacting segment %d with usage count %d (maybe freeable: %2.2f%% [%d bytes])',
segment, segments[segment], freeable_ratio * 100.0, freeable_space)
for tag, key, offset, data in self.io.iter_objects(segment, include_data=True):
if tag == TAG_COMMIT: