Skip to content

Commit

Permalink
persistent-state: Classify Corruption error as impermanent
Browse files Browse the repository at this point in the history
Classify the rocksdb Corruption error as impermanent, meaning that if we
encounter them we'll delete the db on disk and resnapshot the table.
This has been seen in the wild as a result of changing the table format
in d860f07c4 (persistent-state: Use block based SST format, 2023-06-21),
which should have caused an automatic resnapshot but didn't because the
error was classified as permanent

Fixes: REA-2935
Change-Id: Ib0f2a85f824c4b9de84122ee4105096008fd2a50
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5239
Tested-by: Buildkite CI
Reviewed-by: Luke Osborne <luke.o@readyset.io>
  • Loading branch information
glittershark committed Jun 27, 2023
1 parent 2783b75 commit d0bec66
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dataflow-state/src/persistent_state.rs
Expand Up @@ -325,9 +325,7 @@ impl Error {
/// delete the DB file and try again
pub fn is_permanent(&self) -> bool {
match self {
// Could *maybe* try to slice up the RocksDB errors here, but for now it's simpler to
// just assume all RocksDB errors are permanent
Error::RocksDb(_) => true,
Error::RocksDb(e) => !matches!(e.kind(), rocksdb::ErrorKind::Corruption),
// Could *maybe* try to slice up the IO errors here, but for now it's simpler to just
// assume all IO errors are permanent
Error::Io(_) => true,
Expand Down

0 comments on commit d0bec66

Please sign in to comment.