The design of parosd is written in
docs/architecture/, and its
code is not built. The layers are built after the journal, in the order of
#1409. This page explains the design and links each
section; the rules are in the docs.
The problem
Machines fail, lose their disks, change their addresses and come back. A service that keys a machine by its address, or that trusts its memory of which machine is dead, gets each of these wrong one day. And a cell that waits for an operator to replace a machine is down until someone wakes up.
The rule
A machine is an id (rule 5,
§3.2).
A machine is its node_id and its incarnation. Its address is a hint, and “gone” is a record in
the cell control journal, never the memory of one coordinator. A wiped disk gets a new
node_id, so a wiped identity never comes back as the old one.
The life of a machine
formatted → admitted → booked → draining → gone
- Format.
parosdmints a randomnode_idand writes its machine record. The machine is idle: it answersIdentifyand waits. It never forms a cell or joins one on its own. - Bootstrap, by one single decree.
parosctl cell init --members a,b,cruns single-decree Paxos on the plan of the cell, with every listed machine as an acceptor (§3.1). Twocell inits sent to different machines form at most one cell. The decree only writes the first configuration of the cell control journal and the admission of each listed machine. After it, no machine is special. - Admission. Every later machine joins by a request to the cell coordinator
(
cell add-machine). The coordinator writes the admission, then sendsAdmitwith a snapshot of the registry, which the machine keeps on disk. A machine that lost its disk is a new machine, admitted again by a credential. - Bookings. Only the cell coordinator writes a booking: where one role of one journal runs. A machine has no slots; placement spreads roles by busyness.
- Release. A release is not a stop. A released acceptor keeps answering until
may_retireholds (Matchmaker Paxos), and a released matchmaker set stays open. The machine keeps a durable ledger, so a deleted role never starts again. - Gone.
MachineGoneis written only after the routine of rule 4 replaced the machine in each set, one for one. With no machine to take its place, the id stays an unreachable member, each set keeps its size, and the cell reports “cannot place”.
The boot path
A machine must serve the control journal of its cell before it can read its bookings. So it
restores its roles from its own disk first, then registers. The host gets a call that lists the
roles on a disk (#1414 (Storage lists the roles on a disk)), and a part between the cell and the
host turns a booking into Input::Assign and a release into Input::Unassign (#1424 (from a
booking to an Assign)). The journal never reads a booking.
A reference of moonpool RPC names one incarnation, so it changes at each restart. A machine answers one fixed call, “which reference serves this id now”. A peer whose reference is refused asks it once, so it finds a restarted role even when the coordinator of the tenant is down (§4.4).
The cell heals with nobody watching
Goal 2: after the faults stop, each journal is whole again within one bound, or reports a true reason. Two parts do it, and each has one job (§4.4, “The cut of the old tenant coordinator”):
- The grid controller of each journal drives the change of its membership. It changes the
journal only through its fenced reshape call (§J6.1 of the first journal design, at the tag
journal-design-a; the controller is to be designed again). - The cell answers the questions of the whole cell through the placement port: which member must leave (its machine drains, is slow, is held or is gone), where a new member goes, and how many moves run at one time. A grant of the port is also the token of the rate limit of the cell. The calls of the port are Open (#1421 (the placement port)).
In paros
The machine is a crate of layer 5 (#1426 (paros-machine)); the controller of the first journal
design, paros-journal-control, is at the tag journal-design-a. The model cell-control with a machine wiped and admitted again proves
rule 5; it is not proved until its gate is green.