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

Support canceling running RemoteCompaction on remote side #9725

Closed
wants to merge 2 commits into from

Conversation

jay-zhuang
Copy link
Contributor

Add the ability to cancel remote compaction on the remote side by
setting OpenAndCompactOptions.canceled to true.

Test Plan: added unittest

@facebook-github-bot
Copy link
Contributor

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

@jay-zhuang jay-zhuang changed the title Support canceling an running RemoteCompaction on remote side Support canceling running RemoteCompaction on remote side Mar 21, 2022
@jay-zhuang jay-zhuang requested a review from ajkr April 5, 2022 18:01
Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

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

LGTM!

"CompactionJob::Run():Inprogress",
[&](void* /*arg*/) { my_cs->SetCanceled(true); });

s = db_->CompactRange(CompactRangeOptions(), &start, &end);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is coming from a saved background error actually. Maybe assert my_cs became true again after the CompactRange().

Does it still work if you make this CompactRange() in a fresh DB or separate test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, I updated the test to reopen and then run CompactRange() again, as the compaction failure is a background failure which is not recoverable.

Add the ability to cancel remote compaction on the remote side by
setting `OpenAndCompactOptions.canceled` to true.

Test Plan: added unittest
@facebook-github-bot
Copy link
Contributor

@jay-zhuang has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@jay-zhuang has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

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

tabokie pushed a commit to tabokie/rocksdb that referenced this pull request Aug 15, 2023
)

Summary:
Add the ability to cancel remote compaction on the remote side by
setting `OpenAndCompactOptions.canceled` to true.

Pull Request resolved: facebook#9725

Test Plan: added unittest

Reviewed By: ajkr

Differential Revision: D35018800

Pulled By: jay-zhuang

fbshipit-source-id: be3652f9645e0347df429e42a5614d5a9b3a1ec4
Signed-off-by: tabokie <[email protected]>
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