Skip to content

Commit

Permalink
Ignore errors reading column family lists from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Jun 5, 2023
1 parent 532853a commit b695461
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zebra-state/src/service/finalized_state/disk_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,13 @@ impl DiskDb {
let db_options = DiskDb::options();

// When opening the database in read/write mode, all column families must be opened.
//
// To make Zebra forward-compatible with databases updated by later versions,
// we read that list off the disk, then add any new column families from our list as well.
// we read any existing column families off the disk, then add any new column families
// from the current implementation.
//
// <https://github.com/facebook/rocksdb/wiki/Column-Families#reference>
let column_families_on_disk =
DB::list_cf(&db_options, &path).expect("unable to read column families on disk");
let column_families_on_disk = DB::list_cf(&db_options, &path).unwrap_or_default();
let column_families_in_code = Self::COLUMN_FAMILIES_IN_CODE
.iter()
.map(ToString::to_string);
Expand Down

0 comments on commit b695461

Please sign in to comment.