Take control of recovered snapshots, start restoration asynchronously (#2010)

* take control of given snapshot

* start snapshot restoration asynchronously,
This commit is contained in:
Robert Habermeier
2016-08-25 22:20:44 +02:00
committed by Arkadiy Paronyan
parent 2aef81cf90
commit 1c19a807d9
6 changed files with 181 additions and 85 deletions

View File

@@ -121,9 +121,9 @@ impl SnapshotCommand {
// drop the client so we don't restore while it has open DB handles.
drop(service);
if !snapshot.begin_restore(manifest.clone()) {
return Err("Failed to begin restoration.".into());
}
try!(snapshot.init_restore(manifest.clone()).map_err(|e| {
format!("Failed to begin restoration: {}", e)
}));
let (num_state, num_blocks) = (manifest.state_hashes.len(), manifest.block_hashes.len());