-
Notifications
You must be signed in to change notification settings - Fork 92
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
avoid unnecessary live file query and fix double referencing moved file #240
Conversation
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Sorry for delay, will get to this today or tomorrow. |
void Ref() { ++refs; } | ||
|
||
bool Unref() { | ||
--refs; |
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.
How about making ref
be private?
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.
+1
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.
Add more comments overall?
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Looking good overall. Let's send to upstream and see? |
duplicated with #250 |
Signed-off-by: tabokie xy.tao@outlook.com
Obsolete file candidates consist of
obsolete_files_
that are no longer referenced by any version inVersionSet
, and all files in DB directory ifdoing_full_scan
is true. By design,obsolete_files_
is guaranteed to be obsolete and thus no need to be checked against live files list. This PR avoids the unnecessary live file query when not doing full scan.The optimization depends on the assumption that each physical SST file is represented by an unique
FileMetaData
structure, which is actually broken in existing codebase: A trivial file move will create a new file meta for the same file number. This patch also fix this issue.