Prevent possible rocksdb-corruption by running benchmark-storage (#11040)

* Prevent possible rocksdb-corruption by running benchmark-storage

Also adds a `sanitize_key` function to strip path-prefixes from the db-keys (for databases that
use prefixed keys such as rocksdb)

fixes #10998

* Fix @cheme 's annotations.

* Update utils/frame/benchmarking-cli/src/storage/write.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make logic match the name of bool flag `invert_inserts`

* Remove unused lifetime

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Falco Hirschenberger
2022-03-16 17:05:34 +01:00
committed by GitHub
parent 800cc1d4be
commit 7a54efd1f2
4 changed files with 46 additions and 35 deletions
+5
View File
@@ -110,6 +110,11 @@ pub trait Database<H: Clone + AsRef<[u8]>>: Send + Sync {
fn supports_ref_counting(&self) -> bool {
false
}
/// Remove a possible path-prefix from the key.
///
/// Not all database implementations use a prefix for keys, so this function may be a noop.
fn sanitize_key(&self, _key: &mut Vec<u8>) {}
}
impl<H> std::fmt::Debug for dyn Database<H> {