Skip to content

Commit

Permalink
import: use memory to cache split sst instead of disk file (tikv#4566)
Browse files Browse the repository at this point in the history
Signed-off-by: Lonng <chris@lonng.org>
  • Loading branch information
lonng authored and jswh committed May 27, 2019
1 parent 681ec86 commit 6c67bfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/import/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub struct SSTWriter {

impl SSTWriter {
pub fn new(db_cfg: &DbConfig, security_cfg: &SecurityConfig, path: &str) -> Result<SSTWriter> {
let mut env = Arc::new(Env::default());
let mut env = Arc::new(Env::new_mem());
let mut base_env = None;
if !security_cfg.cipher_file.is_empty() {
base_env = Some(Arc::clone(&env));
Expand Down
6 changes: 6 additions & 0 deletions src/import/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ impl<Client: ImportClient> ImportJob<Client> {
"retry_count" => %retry_count,
"current_round" => %i,
);
if i == MAX_RETRY_TIMES - 1 {
res = Err(Error::ImportJobFailed(format!(
"retry {} times still {} ranges failed",
i, retry_count
)))
}
}
IMPORT_EACH_PHASE.with_label_values(&["import"]).set(0.0);

Expand Down

0 comments on commit 6c67bfe

Please sign in to comment.