rishabhdaim opened a new pull request, #2779: URL: https://github.com/apache/jackrabbit-oak/pull/2779
## Summary - Offline compaction (`compactFull()` + `cleanup()` as separate calls, as used by oak-run compact) failed to write a gc.log entry because the `CompactionResult` from `compactFull()` was discarded before `cleanup()` ran - Fix stores the `CompactionResult` in `GarbageCollector` after `compactFull()`/`compactTail()` and passes it directly to the 2-arg `cleanup(Context, CompactionResult)` overload - Added `cleanup(Context, CompactionResult)` to the `GarbageCollectionStrategy` interface so `GarbageCollector` can call it through the interface type ## Changes - `GarbageCollectionStrategy.java` — add `cleanup(Context, CompactionResult)` to the interface - `GarbageCollector.java` — store `lastCompactionResult` after compaction; pass it to cleanup, falling back to a skipped result when absent - `SynchronizedGarbageCollectionStrategy.java` — implement the new 2-arg `cleanup` overload - `DefaultGarbageCollectionStrategyTest.java` — update test setup for the fix - `GarbageCollectorOfflineCompactionTest.java` — new integration tests at `GarbageCollector` level using `ArgumentCaptor` to verify gc.log persistence - `OfflineCompactionGcLogTest.java` — end-to-end regression tests against a real `FileStore` ## Test Plan - [ ] `GarbageCollectorOfflineCompactionTest` — verifies correct `cleanup` overload is called with the right `CompactionResult` - [ ] `OfflineCompactionGcLogTest` — verifies gc.log is written after offline compaction (regression tests, fail on unfixed code) - [ ] `DefaultGarbageCollectionStrategyTest` — existing tests still pass ## Links - JIRA: https://issues.apache.org/jira/browse/OAK-12119 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
