mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
fix the import of dump without unprocessing updates
This commit is contained in:
parent
384afb3455
commit
9e798fea75
@ -208,34 +208,27 @@ pub fn load_dump(
|
|||||||
dump_path.display(),
|
dump_path.display(),
|
||||||
db_path.display()
|
db_path.display()
|
||||||
);
|
);
|
||||||
metadata
|
metadata.dump_version.import_index(
|
||||||
.dump_version
|
size,
|
||||||
.import_index(
|
uuid,
|
||||||
size,
|
&dump_path,
|
||||||
uuid,
|
&db_path,
|
||||||
&dump_path,
|
idx.meta.primary_key.as_ref().map(|s| s.as_ref()),
|
||||||
&db_path,
|
)?;
|
||||||
idx.meta.primary_key.as_ref().map(|s| s.as_ref()),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
info!("Dump importation from {} succeed", dump_path.display());
|
info!("Dump importation from {} succeed", dump_path.display());
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally we can move all the unprocessed update file into our new DB
|
// finally we can move all the unprocessed update file into our new DB
|
||||||
|
// this directory may not exists
|
||||||
let update_path = tmp_dir_path.join("update_files");
|
let update_path = tmp_dir_path.join("update_files");
|
||||||
let db_update_path = db_path.join("updates/update_files");
|
let db_update_path = db_path.join("updates/update_files");
|
||||||
eprintln!("path {:?} exists: {:?}", update_path, update_path.exists());
|
if update_path.exists() {
|
||||||
eprintln!(
|
let _ = std::fs::remove_dir_all(db_update_path);
|
||||||
"path {:?} exists: {:?}",
|
std::fs::rename(
|
||||||
db_update_path,
|
tmp_dir_path.join("update_files"),
|
||||||
db_update_path.exists()
|
db_path.join("updates/update_files"),
|
||||||
);
|
)?;
|
||||||
let _ = std::fs::remove_dir_all(db_update_path);
|
}
|
||||||
std::fs::rename(
|
|
||||||
tmp_dir_path.join("update_files"),
|
|
||||||
db_path.join("updates/update_files"),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
info!("Dump importation from {} succeed", dump_path.display());
|
info!("Dump importation from {} succeed", dump_path.display());
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user