IntersectMBO / IntersectMBO/ouroboros-consensus
Chain DB: allow offline truncation to a certain slot
- Dominant language
- Haskell
- Stars
- 67
- Forks
- 43
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 43
Description
As part of the disaster plan, we should be able to truncate the ChainDB to a given slot number (or point?). Related issue: https://github.com/input-output-hk/cardano-node/issues/1745
* We should just wipe the VolatileDB. Truncating that to the right slot is messy (blocks stored together in a few files, not necessarily ordered by slot) and unnecessary. When this truncation is needed, the slot will most certainly be immutable already, otherwise we could just switch to a different fork and there wouldn't be a disaster in the first place.
* We can leave the LedgerDB alone. When restarting it will reject snapshots that are too new and do a replay from genesis if needed.
* We already have an internal API for testing purposes to truncate the ImmutableDB to a certain point. I'd like keep to such a `truncate` functionality out of the regular API and make it a special offline-only operation. Otherwise there are too many assumptions that will be broken, e.g., what with open iterators and concurrent reads?
Contributor guide
Assessment
This issue has not been assessed yet.