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

Use SST file manager to track blob files as well #8037

Closed

Conversation

akankshamahajan15
Copy link
Contributor

Summary: Extend support to track blob files in SST File manager.
This PR notifies SstFileManager whenever a new blob file is created,
via OnAddFile and an obsolete blob file deleted via OnDeleteFile
and delete file via ScheduleFileDeletion.

Test Plan: Add new unit tests

Reviewers:

Subscribers:

Tasks: T85239542

Tags:

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.

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

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

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.

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

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

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.

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

db/builder.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@ltamasi ltamasi left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @akankshamahajan15 !

db/blob/db_blob_compaction_test.cc Show resolved Hide resolved
db/builder.cc Outdated Show resolved Hide resolved
db/compaction/compaction_job.cc Outdated Show resolved Hide resolved
db/db_impl/db_impl_open.cc Show resolved Hide resolved
db/db_test_util.cc Outdated Show resolved Hide resolved
@ltamasi
Copy link
Contributor

ltamasi commented Mar 10, 2021

@akankshamahajan15
Sorry, couple more things:

  1. Could you also update the comments in sst_file_manager_impl.{h,cc} as needed?
  2. The two OnAddFile overloads and OnAddFileImpl have a boolean parameter compaction, which, as far as I can tell, is always false. Could you confirm this? If so, we could remove this flag and clean up all the code and variables that are related to it. (For instance, seems to me that in_progress_files_size_ / in_progress_files_ are redundant, assuming that compaction is indeed always false.)

@akankshamahajan15
Copy link
Contributor Author

akankshamahajan15 commented Mar 10, 2021

  1. The two OnAddFile overloads and OnAddFileImpl have a boolean parameter compaction, which, as far as I can tell, is always false. Could you confirm this? If so, we could remove this flag and clean up all the code and variables that are related to it. (For instance, seems to me that in_progress_files_size_ / in_progress_files_ are redundant, assuming that compaction is indeed always false.)

Yes, you are right. I checked all the calls and compaction is always false. So I will update the code and remove this parameter and its related code.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

Copy link
Contributor

@riversand963 riversand963 left a comment

Choose a reason for hiding this comment

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

Took another pass, thanks @akankshamahajan15 for the updates.

HISTORY.md Outdated Show resolved Hide resolved
db/blob/blob_file_completion_callback.h Outdated Show resolved Hide resolved
db/compaction/compaction_job.cc Outdated Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

Copy link
Contributor

@ltamasi ltamasi left a comment

Choose a reason for hiding this comment

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

Thanks @akankshamahajan15 ! Looks really nice in general, just some minor comments.

db/builder.cc Outdated Show resolved Hide resolved
db/blob/blob_file_completion_callback.h Show resolved Hide resolved
db/blob/blob_file_completion_callback.h Outdated Show resolved Hide resolved
db/db_impl/db_impl_open.cc Show resolved Hide resolved
file/sst_file_manager_impl.cc Show resolved Hide resolved
@ltamasi
Copy link
Contributor

ltamasi commented Mar 16, 2021

One final thing: as we discussed, failed flushes immediately clean up after themselves here: https://github.com/facebook/rocksdb/blob/master/db/builder.cc#L330-L346 .

Now, when this piece of logic is triggered, we haven't yet notified sfm of the SST; however, we have notified it of any blob files that might have been created. So here, we would need to call OnDeleteFile for the blob files in blob_file_paths as we iterate. (If the deletion was successful that is, which would also enable us to get rid of the PermitUncheckedError there.)

P.S. This could be done through another method in the callback class.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

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.

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

Copy link
Contributor

@ltamasi ltamasi left a comment

Choose a reason for hiding this comment

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

Awesome, thanks once again @akankshamahajan15 !

db/blob/blob_file_completion_callback.h Outdated Show resolved Hide resolved
db/db_impl/db_impl.cc Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

Summary: Extend support to track blob files in SST File manager.
This PR notifies SstFileManager whenever a new blob file is created,
via OnAddFile and  an obsolete blob file deleted via OnDeleteFile
and delete file via ScheduleFileDeletion.

Test Plan: Add new unit tests

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
…s in SSTFileManager

Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary: Add a interface BlobFileCompletionCallback that is passed to
BlobFileBuilder and when a blob file is closed, the interface notifies
SSTFileManager about the file.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

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.

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

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 merged this pull request in 27d57a0.

levichen94 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 18, 2021
Summary:
Extend support to track blob files in SST File manager.
 This PR notifies SstFileManager whenever a new blob file is created,
 via OnAddFile and  an obsolete blob file deleted via OnDeleteFile
 and delete file via ScheduleFileDeletion.

Pull Request resolved: facebook/rocksdb#8037

Test Plan: Add new unit tests

Reviewed By: ltamasi

Differential Revision: D26891237

Pulled By: akankshamahajan15

fbshipit-source-id: 04c69ccfda2a73782fd5c51982dae58dd11979b6
Signed-off-by: Changlong Chen <levisonchen@live.cn>
mm304321141 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 23, 2021
Summary:
Extend support to track blob files in SST File manager.
 This PR notifies SstFileManager whenever a new blob file is created,
 via OnAddFile and  an obsolete blob file deleted via OnDeleteFile
 and delete file via ScheduleFileDeletion.

Pull Request resolved: facebook/rocksdb#8037

Test Plan: Add new unit tests

Reviewed By: ltamasi

Differential Revision: D26891237

Pulled By: akankshamahajan15

fbshipit-source-id: 04c69ccfda2a73782fd5c51982dae58dd11979b6
Signed-off-by: Changlong Chen <levisonchen@live.cn>
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

4 participants