ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LeiosDB.Impl.SQLite.Tooling

Description

Offline maintenance of a LeiosDB partition file, for internal tooling.

These open the file directly, not through a LeiosDbHandle, so they must not run against a file that a node has open.

Synopsis

Documentation

truncateLeiosDbAfterSlot ∷ HasCallStack ⇒ FilePath → SlotNo → IO () Source #

Delete the EBs announced after the given slot.

For internal tooling.

Note: this function works for both the volatile and the immutable partition files. The immutable one has no ebsMissingTxs table (see sql_schema_imm), so the rows there are deleted only if the table exists.

deleteDanglingTxs ∷ HasCallStack ⇒ FilePath → IO () Source #

Delete the transactions that no EB references.

Used in tests.

vacuumLeiosDb ∷ HasCallStack ⇒ FilePath → IO () Source #

Shrink a LeiosDb file to the space its rows need.

A delete frees pages inside the file without returning them to the filesystem. This rewrites the file, so it needs free space of about the size of the file. For internal tooling.