Skip to content

Commit

Permalink
Fix ReclaimedSpaceViaDeletes stats incorrect problem. (#3906)
Browse files Browse the repository at this point in the history
  • Loading branch information
horizonzy authored and zymap committed Jun 19, 2023
1 parent 4d65b9e commit b66af0f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,12 @@ protected void extractMetaFromEntryLogs() throws EntryLogMetadataMapException {
EntryLogMetadata entryLogMeta = entryLogger.getEntryLogMetadata(entryLogId, throttler);
removeIfLedgerNotExists(entryLogMeta);
if (entryLogMeta.isEmpty()) {
LOG.info("Entry log file {} is empty, delete it from disk.", Long.toHexString(entryLogId));
entryLogger.removeEntryLog(entryLogId);
// remove it from entrylogmetadata-map if it is present in
// the map
entryLogMetaMap.remove(entryLogId);
// This means the entry log is not associated with any active
// ledgers anymore.
// We can remove this entry log file now.
LOG.info("Deleting entryLogId {} as it has no active ledgers!", entryLogId);
removeEntryLog(entryLogId);
gcStats.getReclaimedSpaceViaDeletes().addCount(entryLogMeta.getTotalSize());
} else {
entryLogMetaMap.put(entryLogId, entryLogMeta);
}
Expand Down

0 comments on commit b66af0f

Please sign in to comment.