Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on PurgeObsoleteFiles Only for Options file clean up when remote compaction is enabled #13139

Closed
wants to merge 1 commit into from

Conversation

jaykorean
Copy link
Contributor

@jaykorean jaykorean commented Nov 14, 2024

Summary

In PR #13074 , we added a logic to prevent stale OPTIONS file from getting deleted by PurgeObsoleteFiles() if the OPTIONS file is being referenced by any of the scheduled the remote compactions.

PurgeObsoleteFiles() was not the only place that we were cleaning up the old OPTIONS file. We've been also directly cleaning up the old OPTIONS file as part of SetOptions(): RenameTempFileToOptionsFile() -> DeleteObsoleteOptionsFiles() unless FileDeletion is disabled.

This was not caught by the UnitTest because we always preserve the last two OPTIONS file. A single call of SetOptions() was not enough to surface this issue in the previous PR.

To keep things simple, we are just skipping the old OPTIONS file clean up in RenameTempFileToOptionsFile() if remote compaction is enabled. We let PurgeObsoleteFiles() clean up the old options file later after the compaction is done.

Test Plan

Updated UnitTest to reproduce the scenario. It's now passing with the fix.

./compaction_service_test --gtest_filter="*PreservedOptionsRemoteCompaction*"

@jaykorean jaykorean changed the title [Remote Compaction] Rely on PurgeObsoleteFiles Only for Options file clean up when remote compaction is enabled Rely on PurgeObsoleteFiles Only for Options file clean up when remote compaction is enabled Nov 14, 2024
@jaykorean jaykorean marked this pull request as ready for review November 14, 2024 23:05
@facebook-github-bot
Copy link
Contributor

@jaykorean has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@jaykorean merged this pull request in 3495c94.

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

Successfully merging this pull request may close these issues.

3 participants