refactor: Eliminate redundant cleanup logic in entry log extraction#4599
Draft
nodece wants to merge 2 commits intoapache:masterfrom
Draft
refactor: Eliminate redundant cleanup logic in entry log extraction#4599nodece wants to merge 2 commits intoapache:masterfrom
nodece wants to merge 2 commits intoapache:masterfrom
Conversation
liudezhi2098
approved these changes
May 6, 2025
Member
|
rerun failure checks |
3 similar comments
Member
Author
|
rerun failure checks |
Member
Author
|
rerun failure checks |
Member
Author
|
rerun failure checks |
AnonHxy
reviewed
May 16, 2025
| * Garbage collect those entry loggers which are not associated with any active ledgers. | ||
| */ | ||
| private void doGcEntryLogs() throws EntryLogMetadataMapException { | ||
| protected void doGcEntryLogs() throws EntryLogMetadataMapException { |
Contributor
There was a problem hiding this comment.
protectd could be removed. Default access modifiers is enough.
Member
Author
|
In the current implementation, all metadata is first extracted and stored in a map before performing a full GC pass over the entire dataset. This approach can result in high memory usage and delayed cleanup, especially in environments with large or fragmented metadata stores. I suggest we should replace the current bulk extraction + GC logic with an incremental streaming approach, as follows: Current Approach: Proposed Approach: Benefits:
|
hangc0276
requested changes
Jun 5, 2025
Contributor
hangc0276
left a comment
There was a problem hiding this comment.
The current logic can cleanup those no active ledger's entrylog files immediately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The purpose of
extractMetaFromEntryLogsis to extract metadata, not perform garbage collection. The logic for removing entry logs with no active ledgers is handled separately indoGcEntryLogs().Changes
This change removes the redundant cleanup code from
extractMetaFromEntryLogsto better separate concerns and avoid duplication.