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

engine: skip check raft cf in delete range #4663

Merged
merged 3 commits into from May 9, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -10,7 +10,7 @@ pub trait Mutable: Writable {
Ok(())
}

// TOOD: change CFHandle to str.
// TODO: change CFHandle to str.
fn put_msg_cf<M: protobuf::Message>(&self, cf: &CFHandle, key: &[u8], m: &M) -> Result<()> {
let value = m.write_to_bytes()?;
self.put_cf(cf, key, &value)?;
@@ -4,7 +4,7 @@ use std::u64;

use crate::rocks;
use crate::rocks::{Range, TablePropertiesCollection, Writable, WriteBatch, DB};
use crate::{CF_LOCK, CF_RAFT};
use crate::CF_LOCK;

use super::{Error, Result};
use super::{IterOption, Iterable};
@@ -59,9 +59,7 @@ pub fn delete_all_in_range_cf(
) -> Result<()> {
let handle = rocks::util::get_cf_handle(db, cf)?;
let wb = WriteBatch::new();
// Since CF_RAFT and CF_LOCK is usually small, so using
// traditional way to cleanup.
if use_delete_range && cf != CF_RAFT && cf != CF_LOCK {
if use_delete_range && cf != CF_LOCK {

This comment has been minimized.

Copy link
@Connor1996

Connor1996 May 9, 2019

Member

so should we add assert!(Cf != CF_RAFT)?

This comment has been minimized.

Copy link
@overvenus

overvenus May 9, 2019

Author Contributor

I don't think so, it's totally ok to delete range on the raft cf, because it deletes nothing. After #4372 is merged, it returns an error because there is no such cf.

wb.delete_range_cf(handle, start_key, end_key)?;
} else {
let start = KeyBuilder::from_slice(start_key, 0, 0);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.