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

roughly cleanup data between regions gap #2273

Merged
merged 4 commits into from
Sep 12, 2017

Conversation

zhangjinpeng87
Copy link
Member

No description provided.

// 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 {
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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.

@ngaut ngaut assigned BusyJay and unassigned BusyJay Sep 11, 2017
@ngaut ngaut requested a review from BusyJay September 11, 2017 12:13
Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

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

rest LGTM

try!(db.delete_file_in_range_cf(handle, start_key, iter.key()));
iter.seek(start_key.into());
let wb = WriteBatch::new();
while iter.valid() {
Copy link
Member

Choose a reason for hiding this comment

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

How about if + loop?

Copy link
Member

@BusyJay BusyJay left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@huachaohuang huachaohuang left a comment

Choose a reason for hiding this comment

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

LGTM

@zhangjinpeng87 zhangjinpeng87 merged commit 8c89a1a into master Sep 12, 2017
@zhangjinpeng87 zhangjinpeng87 deleted the zhangjinpeng/roughly-cleanup branch September 12, 2017 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants