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

Update SstFileManager to also smooth deletes for WAL files #2768

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IslamAbdelRahman
Copy link
Contributor

WAL files could be huge which will cause stalls if they are deleted quickly.
This patch update SstFileManager to also rate limit the deletes for WAL files

@facebook-github-bot
Copy link
Contributor

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

@@ -2300,7 +2298,8 @@ Status DestroyDB(const std::string& dbname, const Options& options) {
// Delete log files in the WAL dir
for (const auto& file : walDirFiles) {
if (ParseFileName(file, &number, &type) && type == kLogFile) {
Status del = env->DeleteFile(LogFileName(soptions.wal_dir, number));
Status del = DeleteDBFile(
&soptions, LogFileName(soptions.wal_dir, number), 0, type);
Copy link
Contributor

@ajkr ajkr Aug 21, 2017

Choose a reason for hiding this comment

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

I'm not sure about using path_id == 0 when wal_dir is set. Feels to me we should treat files that aren't in db_paths[0] directory the same. It might be required for correctness, too, as wal_dir might not be on the same filesystem as db_paths[0] and trash_dir.

@facebook-github-bot
Copy link
Contributor

@IslamAbdelRahman has updated the pull request.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

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

@IslamAbdelRahman
Copy link
Contributor Author

updated and rebased
@ajkr, can you please take a look :)

@ajkr ajkr self-assigned this Jan 12, 2018
@ajkr
Copy link
Contributor

ajkr commented Jan 12, 2018

sorry I missed it

if (sfm && path_id == 0) {

if (sfm != nullptr &&
((type == kTableFile && path_id == 0) || type == kLogFile)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you get rid of the path_id == 0 restriction now that the trash files don't need to be moved?

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.

had a question

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours has expired.

Before we can review or merge your code, we need you to email cla@fb.com with your details so we can update your status.

@anand1976
Copy link
Contributor

@IslamAbdelRahman Do you plan to continue with this PR? If not, I can update and land it if you don't mind

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@IslamAbdelRahman
Copy link
Contributor Author

@anand1976, Yes please take it over

facebook-github-bot pushed a commit that referenced this pull request Mar 28, 2019
Summary:
WAL files are currently not subject to deletion rate limiting by DeleteScheduler. If the size of the WAL files is significant, this can cause a high delete rate on SSDs that may affect other operations. To fix it, force WAL file deletions to go through the SstFileManager. Original PR for this is #2768
Pull Request resolved: #5116

Differential Revision: D14669437

Pulled By: anand1976

fbshipit-source-id: c5f62d0640cebaa1574de841a1d01e4ce2faadf0
vagogte pushed a commit to vagogte/rocksdb that referenced this pull request Jun 18, 2019
Summary:
WAL files are currently not subject to deletion rate limiting by DeleteScheduler. If the size of the WAL files is significant, this can cause a high delete rate on SSDs that may affect other operations. To fix it, force WAL file deletions to go through the SstFileManager. Original PR for this is facebook#2768
Pull Request resolved: facebook#5116

Differential Revision: D14669437

Pulled By: anand1976

fbshipit-source-id: c5f62d0640cebaa1574de841a1d01e4ce2faadf0
@siying
Copy link
Contributor

siying commented Sep 10, 2019

I believe @anand1976 has already done this functionality. Assign to him so that he can verify and close it if it is the case.

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.

None yet

5 participants