Skip to content

OAK-12121 : add regression tests for offline compaction not persisting gc.log#2776

Open
rishabhdaim wants to merge 2 commits intotrunkfrom
OAK-12121
Open

OAK-12121 : add regression tests for offline compaction not persisting gc.log#2776
rishabhdaim wants to merge 2 commits intotrunkfrom
OAK-12121

Conversation

@rishabhdaim
Copy link
Contributor

Summary

  • Adds OfflineCompactionGcLogTest — three regression tests that directly expose the bug where offline compaction (compactFull() + cleanup() as separate calls) never writes a gc.log entry
  • All three tests fail against the unfixed code and pass once the fix retaining CompactionResult across the two calls is applied

Changes

  • oak-segment-tar/src/test/java/.../file/OfflineCompactionGcLogTest.java (new file)
    • testOfflineCompactionPersistsGcLog — basic offline compaction scenario: verifies gc.log has a valid entry with non-empty root id and incremented GC generation
    • testCleanupFirstCompactOkCleanupGcLogWritten — cleanup → compact → cleanup: pre-compaction cleanup must not write gc.log; only the post-compaction cleanup should
    • testCompactOkCleanupCleanupGcLogHasExactlyOneEntry — compact → cleanup → cleanup: first cleanup writes, second must not write a duplicate

Test Plan

  • All three new tests fail on unfixed code (regression tests)
  • All three new tests pass once the fix is applied

Links

@rishabhdaim rishabhdaim self-assigned this Mar 2, 2026
@rishabhdaim rishabhdaim requested review from dulceanu and reschke March 2, 2026 17:05
@rishabhdaim
Copy link
Contributor Author

@lweitzendorf could you please review these test cases.

Copy link
Contributor

@reschke reschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...grom the perspective that it reproduces the issue, so we can proceed with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants