Documentation
¶
Overview ¶
Package dataepoch is the data-compatibility contract between proxy builds (ADR-0062 slice 6a, contract UPG-003).
A data epoch is a whole number that changes only when a release migrates persisted state under /data into a form an older build cannot read. Two facts are compared before any older image is put back on this data:
- the data directory's epoch: the marker file <dataDir>/.data-epoch, which only ever rises. A build raises it to its own Current before it writes anything in the newer form, and never lowers it. An absent marker means epoch 1: only builds released before this package existed have written the data, and every one of them reads and writes epoch 1.
- the epochs an image reads: the labels io.culvert.data-epoch.min and io.culvert.data-epoch.max on the image, which are this package's OldestReadable and Current (Dockerfile; a drift test keeps them equal).
An image may run on data whose epoch lies in [min, max]. An image without the labels says nothing, and nothing may assume it can read the data.
Bumping Current is a release decision with obligations recorded in docs/engineering/data-epoch.md; a tripwire test in the root package fails while they are not met.
Index ¶
Constants ¶
const ( // Current is the epoch this build writes. Current = 1 // OldestReadable is the oldest epoch this build reads. OldestReadable = 1 // MarkerName is the marker's file name under the data directory. MarkerName = ".data-epoch" // LabelMin is the image label naming the oldest epoch the image reads. LabelMin = "io.culvert.data-epoch.min" // LabelMax is the image label naming the newest epoch the image reads. LabelMax = "io.culvert.data-epoch.max" // ImplicitEpoch is the epoch of a data directory with no marker. ImplicitEpoch = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Outcome ¶
type Outcome int
Outcome of RaiseTo.
const ( // Unchanged means the data was already at the epoch (or the marker is absent // and the epoch is the implicit one), so nothing was written. Unchanged Outcome = iota // Raised means the marker now names the epoch. Raised // Newer means the data is at a higher epoch than asked; nothing was written. Newer )
type Reading ¶
type Reading struct {
Epoch int
// Present is false when there is no marker (Epoch is then ImplicitEpoch).
Present bool
}
Reading is what Read found.
type Report ¶
type Report struct {
Schema int `json:"schema"`
Epoch int `json:"epoch"`
MarkerPresent bool `json:"marker_present"`
BuildMin int `json:"build_min"`
BuildMax int `json:"build_max"`
}
Report is what `culvert --print-data-epoch` prints: the data directory's epoch and the range this build reads.