[stable] Backports (#5297)

* v1.5.12

* Fine grained snapshot chunking
This commit is contained in:
Arkadiy Paronyan
2017-03-27 19:11:24 +02:00
committed by GitHub
parent 0721e33dd3
commit 0caaa01965
21 changed files with 225 additions and 114 deletions

View File

@@ -347,10 +347,7 @@ impl JournalDB for OverlayRecentDB {
match rc {
0 => {}
1 => {
if cfg!(debug_assertions) && self.backing.get(self.column, &key)?.is_some() {
return Err(BaseDataError::AlreadyExists(key).into());
}
_ if rc > 0 => {
batch.put(self.column, &key, &value)
}
-1 => {
@@ -359,7 +356,7 @@ impl JournalDB for OverlayRecentDB {
}
batch.delete(self.column, &key)
}
_ => panic!("Attempted to inject invalid state."),
_ => panic!("Attempted to inject invalid state ({})", rc),
}
}