coven_database/load_step.rs
1//! The steps of loading a store from storage onto a new installation, which
2//! a host draws a bar for (§13.4, api.md E10).
3
4use coven_merge::Audience;
5
6/// A step of loading a store from storage (§13.4), in the order they run. A
7/// step runs only when it has work to do.
8#[derive(Clone, Debug, PartialEq, Eq)]
9pub enum LoadStep {
10 /// Reading slots for copies of this member's keys: from the floor's
11 /// first kept slot, or from slot 1 without a floor, or, for a join, from
12 /// its invite, to the end of the sequence. It runs only when the floor
13 /// holds no copy for this member. Done counts the slots passed and total
14 /// the end found once the first slot is read; slots that land while it
15 /// reads raise the total.
16 FindingKeys,
17 /// Streaming one of the floor's snapshots from storage, staging its rows
18 /// as they arrive: the store's first, then each circle's this member
19 /// reads. Done and total count bytes of the snapshot's object.
20 Streaming(Audience),
21 /// Installing the staged snapshots' rows. Done and total count tables:
22 /// installing passes over each snapshot's tables six times, to copy
23 /// their rows, check them three ways, write their merge records and
24 /// check that every row has one, and each table counts once in each pass.
25 Installing,
26 /// Applying the slots from the snapshots' coverage to the load's target,
27 /// in the same transaction. Done and total count slots.
28 InstallingSlots,
29 /// Reading the slots after that target, to the end of the sequence.
30 /// Done and total count slots; the total is the end found as the step
31 /// begins, and grows if slots land while it reads.
32 Reading,
33 /// Applying the slots it read, one transaction each. Done and total
34 /// count slots.
35 Applying,
36}
37
38#[cfg(test)]
39#[path = "load_step_tests.rs"]
40mod tests;