-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Blob DB: Improve FIFO eviction #3556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yiwu-arbug has updated the pull request. View: changes, changes since last import |
@@ -199,6 +203,9 @@ class BlobDB : public StackableDB { | |||
return NewIterator(options); | |||
} | |||
|
|||
using rocksdb::StackableDB::Close; | |||
virtual Status Close() override = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anand1976 I think we have a problem now with Close() still being virtual and people override that instead of CloseImpl(). This will make a confusing experience with some DB overriding Close() and others CloseImpl(). Should Close() be made non-virtual? What was the final decision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree it should be non-virtual.. if people override Close()
they can't set closed_ = true
and then DBImpl::CloseHelper
will always be called in destruction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ignore my comment. This StackableDB
class doesn't subclass DBImpl
so my comment was wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed with @anand1976 and @ajkr. I'm going to implement CloseImpl() not Close(). I'll split the change to another PR for review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no DB::CloseImpl(). The Close()/CloseImpl() pattern was only for the Logger class. Although after talking with @yiwu-arbug and @ajkr it makes sense to have the same pattern in DB as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go ahead with my current PR and wait till changes on DBImpl side to change to use CloseImpl().
@yiwu-arbug has updated the pull request. View: changes, changes since last import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@yiwu-arbug has updated the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiwu-arbug has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me from the BlobDB perspective, subject to the discussion around close/closeimpl. Lets update here with the summary of the discussion that you had with Anand about Close.
Regarding DB::Close(), @anand1976 will make the change to DBImpl similar to what he did for Logger #3528. Subclasses of StackableDB will need to implement a ::CloseImpl method and the order of execution will be analogous to destructor: derived class's CloseImpl will be called first and then base class's CloseImpl. StackableDB::Close() will be non-virtual and is responsible to call CloseImpl in order, and setting closed_ flag so a second Close() will be noop. I'll leave the implementation here as-is, and wait till the change on DBImpl side and make change to BlobDB accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiwu-arbug is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary:
Improving blob db FIFO eviction with the following changes,
Test Plan:
See the new tests.