OAK-12119 : offline compaction does not persist compacted head into gc.log#2779
Merged
rishabhdaim merged 4 commits intotrunkfrom Mar 5, 2026
Merged
OAK-12119 : offline compaction does not persist compacted head into gc.log#2779rishabhdaim merged 4 commits intotrunkfrom
rishabhdaim merged 4 commits intotrunkfrom
Conversation
Contributor
Author
|
@lweitzendorf could you please review the changes ? |
reschke
approved these changes
Mar 5, 2026
Contributor
reschke
left a comment
There was a problem hiding this comment.
Lacking detailed knowledge of publish persistence, I can only say: it has tests that prove the bug and the fix. Good.
FWIW, at least one of the Sonar warnings might be of interest.
Contributor
Author
Addressed in 3635689 |
lweitzendorf
approved these changes
Mar 5, 2026
Contributor
lweitzendorf
left a comment
There was a problem hiding this comment.
Looks good, thanks for the fix!
|
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.



Summary
compactFull()+cleanup()as separate calls, as used by oak-run compact) failed to write a gc.log entry because theCompactionResultfromcompactFull()was discarded beforecleanup()ranCompactionResultinGarbageCollectoraftercompactFull()/compactTail()and passes it directly to the 2-argcleanup(Context, CompactionResult)overloadcleanup(Context, CompactionResult)to theGarbageCollectionStrategyinterface soGarbageCollectorcan call it through the interface typeChanges
GarbageCollectionStrategy.java— addcleanup(Context, CompactionResult)to the interfaceGarbageCollector.java— storelastCompactionResultafter compaction; pass it to cleanup, falling back to a skipped result when absentSynchronizedGarbageCollectionStrategy.java— implement the new 2-argcleanupoverloadDefaultGarbageCollectionStrategyTest.java— update test setup for the fixGarbageCollectorOfflineCompactionTest.java— new integration tests atGarbageCollectorlevel usingArgumentCaptorto verify gc.log persistenceOfflineCompactionGcLogTest.java— end-to-end regression tests against a realFileStoreTest Plan
GarbageCollectorOfflineCompactionTest— verifies correctcleanupoverload is called with the rightCompactionResultOfflineCompactionGcLogTest— verifies gc.log is written after offline compaction (regression tests, fail on unfixed code)DefaultGarbageCollectionStrategyTest— existing tests still passLinks