|
|
@ -33,8 +33,9 @@ fn restore_from_latest() { |
|
|
|
let value = db.get(b"k1"); |
|
|
|
let value = db.get(b"k1"); |
|
|
|
assert_eq!(value.unwrap().unwrap(), b"v1111"); |
|
|
|
assert_eq!(value.unwrap().unwrap(), b"v1111"); |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
let backup_path = DBPath::new("restore_from_latest_test_backup"); |
|
|
|
let env = Env::new().unwrap(); |
|
|
|
let env = Env::new().unwrap(); |
|
|
|
let backup_opts = BackupEngineOptions::new("backup_path_1").unwrap(); |
|
|
|
let backup_opts = BackupEngineOptions::new(&backup_path).unwrap(); |
|
|
|
|
|
|
|
|
|
|
|
let mut backup_engine = BackupEngine::open(&backup_opts, &env).unwrap(); |
|
|
|
let mut backup_engine = BackupEngine::open(&backup_opts, &env).unwrap(); |
|
|
|
assert!(backup_engine.create_new_backup(&db).is_ok()); |
|
|
|
assert!(backup_engine.create_new_backup(&db).is_ok()); |
|
|
@ -74,8 +75,9 @@ fn restore_from_backup() { |
|
|
|
let value = db.get(b"k1"); |
|
|
|
let value = db.get(b"k1"); |
|
|
|
assert_eq!(value.unwrap().unwrap(), b"v1111"); |
|
|
|
assert_eq!(value.unwrap().unwrap(), b"v1111"); |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
let backup_path = DBPath::new("restore_from_latest_test_backup"); |
|
|
|
let env = Env::new().unwrap(); |
|
|
|
let env = Env::new().unwrap(); |
|
|
|
let backup_opts = BackupEngineOptions::new("backup_path_2").unwrap(); |
|
|
|
let backup_opts = BackupEngineOptions::new(&backup_path).unwrap(); |
|
|
|
|
|
|
|
|
|
|
|
let mut backup_engine = BackupEngine::open(&backup_opts, &env).unwrap(); |
|
|
|
let mut backup_engine = BackupEngine::open(&backup_opts, &env).unwrap(); |
|
|
|
assert!(backup_engine.create_new_backup(&db).is_ok()); |
|
|
|
assert!(backup_engine.create_new_backup(&db).is_ok()); |
|
|
|