mozilla / rkv

A simple, humane, typed key-value storage solution.
https://crates.io/crates/rkv
Apache License 2.0
304 stars 52 forks source link

Replace set_discard_if_corrupted with a set_corruption_recovery_strategy #234

Closed badboy closed 7 months ago

badboy commented 1 year ago
enum RecoveryStrategy {
    /// Discard the corrupted data and start with an empty database
    Discard,
    /// Move the corrupted data file to `$file.corrupt` and start with an empty database
    Rename,
    /// Bubble up the error on detecting a corrupted data file
    Error,
}

See https://bugzilla.mozilla.org/show_bug.cgi?id=1645907#c11