Skip to content

Commit

Permalink
Fix ReclaimedSpaceViaDeletes stats incorrect problem. (apache#3906)
Browse files Browse the repository at this point in the history
  • Loading branch information
horizonzy authored and hangc0276 committed Jun 26, 2023
1 parent 1e0c15d commit e9b5e2a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,12 @@ protected Map<Long, EntryLogMetadata> extractMetaFromEntryLogs(Map<Long, EntryLo
EntryLogMetadata entryLogMeta = entryLogger.getEntryLogMetadata(entryLogId);
removeIfLedgerNotExists(entryLogMeta);
if (entryLogMeta.isEmpty()) {
entryLogger.removeEntryLog(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().add(entryLogMeta.getTotalSize());
} else {
entryLogMetaMap.put(entryLogId, entryLogMeta);
}
Expand Down

0 comments on commit e9b5e2a

Please sign in to comment.