Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
418: fix: try to repair a corrupted rocksdb automatically r=quake a=yangby-cryptape I have test this patch with a corrupted database (from @TheWaWaR). But I can not reproduce the bug by myself, so I did not write any test case. The database works, but the data is still corrupted (**because `header` add new fields?**): ``` 2019-04-09 07:39:24.154 +00:00 main WARN ckb_db::diskdb Try repairing the rocksdb since Corruption: SST file is ahead of WALs ... 2019-04-09 07:39:24.384 +00:00 main WARN ckb_db::diskdb Try opening the repaired rocksdb ... thread 'main' panicked at 'header deserializing should be ok: Custom("invalid length 3, expected a 0x-prefixed hex string with 64 digits")', src/libcore/result.rs:997:5 stack backtrace: ``` Ref: - [RocksDB: Repairer](https://github.com/facebook/rocksdb/wiki/RocksDB-Repairer) - [RocksDB: WAL Recovery Modes](https://github.com/facebook/rocksdb/wiki/WAL-Recovery-Modes) - [`pub fn set_wal_recovery_mode(&mut self, mode: DBRecoveryMode)`](https://github.com/rust-rocksdb/rust-rocksdb/blob/267d92cbf9fdcbce9052ef06d7cb90b3111c6c54/src/db_options.rs#L1042-L1046) Co-authored-by: Boyu Yang <yangby@cryptape.com>
- Loading branch information