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

Configurable delete range #2573

Merged
merged 33 commits into from
Dec 27, 2017

Conversation

zhangjinpeng87
Copy link
Member

No description provided.

@zhangjinpeng87 zhangjinpeng87 changed the title [DNM] Configurable delete range Configurable delete range Dec 12, 2017
@zhangjinpeng87
Copy link
Member Author

PTAL

@@ -151,8 +148,7 @@ fn check_and_open(
}
}
}
let cfds = cfs_v.into_iter().zip(cfs_opts_v).collect();
let mut db = DB::open_cf(db_opt, path, cfds).unwrap();
let mut db = DB::open_cf(db_opt, path, cfs_v.into_iter().zip(cfs_opts_v).collect()).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why combine these into one line?

@@ -309,6 +309,8 @@ pub struct ApplyDelegate {
term: u64,
pending_cmds: PendingCmdQueue,
metrics: ApplyMetrics,

use_delete_range: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it more suitable to put this to ApplyContext?

@@ -1974,7 +1996,7 @@ mod tests {
let obs = ApplyObserver::default();
host.registry
.register_query_observer(1, Box::new(obs.clone()));
let mut apply_ctx = ApplyContext::new(&host);
let mut apply_ctx = ApplyContext::new(&host, true /* use delete range */);
Copy link
Contributor

Choose a reason for hiding this comment

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

can remove the comment

@siddontang
Copy link
Contributor

Do we still need to support the test without DeleteRange now?

Rest LGTM

PTAL @huachaohuang @BusyJay

@huachaohuang
Copy link
Contributor

LGTM

@siddontang
Copy link
Contributor

@zhangjinpeng1987 I think we can merge this, and use delete range as default in our all tests now.

@zhangjinpeng87
Copy link
Member Author

/run-all-tests

@zhangjinpeng87 zhangjinpeng87 merged commit 0fe3f22 into tikv:master Dec 27, 2017
@zhangjinpeng87 zhangjinpeng87 deleted the configurable-delete-range branch December 27, 2017 07:08
@@ -254,7 +260,9 @@ impl SnapContext {
escape(&start_key),
escape(&end_key)
);
if let Err(e) = util::delete_all_in_range(&self.kv_db, &start_key, &end_key) {
if let Err(e) =
util::delete_all_in_range(&self.kv_db, &start_key, &end_key, self.use_delete_range)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's appropriate to use delete range here. For long running queries, delete all sst files directly may introduce wrong result.

Copy link
Member Author

Choose a reason for hiding this comment

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

delete range will not break snapshot, so it is ok.

Copy link
Member

Choose a reason for hiding this comment

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

Why? When SST files are deleted, keys in the bottom level can be seen by the snapshot.

Copy link
Member Author

Choose a reason for hiding this comment

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

delete range never drop sst files directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you misunderstand delete files in range and delete range.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see. I thought use_delete_range is a hint for delete_file_in_range. It's OK to use delete_range here. Thanks for the explanation.

sticnarf pushed a commit to sticnarf/tikv that referenced this pull request Oct 27, 2019
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