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

Keep track of obsolete blob files in VersionSet #6755

Closed
wants to merge 13 commits into from

Conversation

ltamasi
Copy link
Contributor

@ltamasi ltamasi commented Apr 24, 2020

Summary:
The patch adds logic to keep track of obsolete blob files. A blob file becomes
obsolete when the last shared_ptr that points to the corresponding
SharedBlobFileMetaData object goes away, which, in turn, happens when the
last Version that contains the blob file is destroyed. No longer needed blob
files are added to the obsolete list in VersionSet using a custom deleter to
avoid unnecessary coupling between SharedBlobFileMetaData and VersionSet.
Obsolete blob files are returned by VersionSet::GetObsoleteFiles and stored
in JobContext.

Test Plan:
make check

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.

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

@facebook-github-bot
Copy link
Contributor

@ltamasi has updated the pull request. Re-import 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.

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

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.

LGTM. Thanks @ltamasi for adding this.

db/job_context.h Outdated Show resolved Hide resolved
db/version_builder.cc Outdated Show resolved Hide resolved
db/version_builder.cc Outdated Show resolved Hide resolved
db/version_builder.cc Show resolved Hide resolved
@facebook-github-bot
Copy link
Contributor

@ltamasi has updated the pull request. Re-import 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.

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

@facebook-github-bot
Copy link
Contributor

@ltamasi merged this pull request in fe238e5.

facebook-github-bot pushed a commit that referenced this pull request May 4, 2020
Summary:
The patch adds logic that returns the set of live blob files from
`Version::AddLiveFiles` and `VersionSet::AddLiveFiles` (in addition to
live table files), and also cleans up the code a bit, for example, by
exposing only the numbers of table files as opposed to the earlier
`FileDescriptor`s that no clients used. Moreover, the patch extends
the `GetLiveFiles` API so that it also exposes blob files in the current version.
Similarly to #6755,
this is a building block for identifying and purging obsolete blob files.
Pull Request resolved: #6785

Test Plan: `make check`

Reviewed By: riversand963

Differential Revision: D21336210

Pulled By: ltamasi

fbshipit-source-id: fc1aede8a49eacd03caafbc5f6f9ce43b6270821
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