diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-10 16:38:31 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-10 16:38:31 +0100 |
commit | 445912dc6a3b65d0726b9378b3542b4061272cf4 (patch) | |
tree | bf1ac419b305254b71b9e17857f1e926ef6c2844 /src/garage | |
parent | 0fd7df8fa0741caa622b2bae979aac867f443154 (diff) | |
download | garage-445912dc6a3b65d0726b9378b3542b4061272cf4.tar.gz garage-445912dc6a3b65d0726b9378b3542b4061272cf4.zip |
Remove migration paths from 0.1 branch
Diffstat (limited to 'src/garage')
-rw-r--r-- | src/garage/Cargo.toml | 1 | ||||
-rw-r--r-- | src/garage/server.rs | 23 |
2 files changed, 1 insertions, 23 deletions
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml index 03bc472d..115e2d0e 100644 --- a/src/garage/Cargo.toml +++ b/src/garage/Cargo.toml @@ -29,7 +29,6 @@ log = "0.4" pretty_env_logger = "0.4" sled = "0.34" -old_sled = { package = "sled", version = "0.31" } structopt = { version = "0.3", default-features = false } toml = "0.5" diff --git a/src/garage/server.rs b/src/garage/server.rs index 2e109f8b..a0ab17c4 100644 --- a/src/garage/server.rs +++ b/src/garage/server.rs @@ -40,28 +40,7 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> { info!("Opening database..."); let mut db_path = config.metadata_dir.clone(); db_path.push("db"); - let db = match sled::open(&db_path) { - Ok(db) => db, - Err(e) => { - warn!("Old DB could not be openned ({}), attempting migration.", e); - let old = old_sled::open(&db_path).expect("Unable to open old DB for migration"); - let mut new_path = config.metadata_dir.clone(); - new_path.push("db2"); - let new = sled::open(&new_path).expect("Unable to open new DB for migration"); - new.import(old.export()); - if old.checksum().expect("unable to compute old db checksum") - != new.checksum().expect("unable to compute new db checksum") - { - panic!("db checksums don't match after migration"); - } - drop(new); - drop(old); - std::fs::remove_dir_all(&db_path).expect("Cannot remove old DB folder"); - std::fs::rename(new_path, &db_path) - .expect("Cannot move new DB folder to correct place"); - sled::open(db_path).expect("Unable to open new DB after migration") - } - }; + let db = sled::open(&db_path).expect("Unable to open sled DB"); info!("Initialize RPC server..."); let mut rpc_server = RpcServer::new(config.rpc_bind_addr.clone(), config.rpc_tls.clone()); |