IntersectMBO / IntersectMBO/ouroboros-consensus

Chain DB: allow offline truncation to a certain slot

Open
#658 4 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.