-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
roughly cleanup data between regions gap #2273
Conversation
// we treat CF_LOCK especially. For the others column families: 1) the data set | ||
// in these column families usually are very large, so we don't want to trigger | ||
// seek for these column families; 2) keys in these column families have ts tail, | ||
// so end_key never exists in these column families. | ||
if cf == CF_LOCK { |
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 think we can ignore lock and raft and let outer clean up the region.
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 function only used in quickly cleanup data between regions gaps, there is no more
other cleanup outer.
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.
So when we really clean up all data for the region? Will leave some stale data?
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.
Yes, will leave some stale data, but if we don't have a mechanism to roughly cleanup these stale data, there is a risk that the stale data may increase to very huge.
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.
rest LGTM
src/util/rocksdb/mod.rs
Outdated
try!(db.delete_file_in_range_cf(handle, start_key, iter.key())); | ||
iter.seek(start_key.into()); | ||
let wb = WriteBatch::new(); | ||
while iter.valid() { |
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 if
+ loop
?
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.
LGTM
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.
LGTM
No description provided.