Skip to main content

Module journal

Module journal 

Source
Expand description

The record a run leaves before its first replacement.

Without it, a process that dies partway through a multi-file write leaves no statement of what it was doing, and the in-memory backup map that would restore it dies with the process. The journal names every destination, the digest of what was there, and the digest of what the run intends to put there, and it is written and synced before the first rename.

Recovery goes one way: back to what was there. Both writers use it, the skill install and the repository apply alike. A run that did not finish is undone whole, including its record, so the target returns to one state it was in rather than to a mixture of two. Completing forward would need a durable commit marker and a second recovery path, and the cost of rolling back instead is one re-run of a plan that is still stored under its own id.

Structs§

Entry
One destination a run touches.
Journal
An open journal. Its file exists until Journal::finish removes it.
Record
What one journal file holds.

Enums§

EntryState
How far one destination has got.

Constants§

SCHEMA_VERSION
The journal schema this binary writes and recovers.

Functions§

recover
Roll back an outstanding run, if one is there.