paros ~
GitHub →
parosd · rewrite in progress

parosd

The journal service: one binary on N machines that serves journals to many tenants and heals itself. It is being rebuilt on the journal v1, as a stack of layers.

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.

What it will be

One binary, parosd, on N machines of a cell. It serves journals to many tenants over the four calls of the journal: Write, Read, Truncateand SetLeader. When a disk or a machine is lost, the cell heals through reconfiguration, with no operator call. Cells sit in a universe, and a tenant lives in one cell.

paros eats its own food: the state of the service lives in journals, who acts is decided by SetLeader on a journal, and agreement comes from the Paxos flavors that paros-consensus builds. There is no external coordination service to run. The target design is docs/architecture/; most of what it names is at the tag below, not in the tree.

The goals

Eleven goals say what paros is for and how it is built. Each rule of the design is a consequence of one of them (docs/architecture/01-goal.md, §1.1).

  1. A journal service for tenants. Four calls, and a durable, ordered, fenced log. paros owns the log, never the state.
  2. The cell heals with nobody watching. After the faults stop, each journal is whole again within one bound, or reports a true reason.
  3. paros eats its own food. State is in journals, who acts is an election on a journal, and agreement is a Paxos flavor of the core.
  4. One shape at every level. The universe, a cell and a tenant are each a control journal, a pure fold and one coordinator.
  5. The person says what, the system says where. A person types names and what a journal must survive. The system chooses the machines and the ids.
  6. Everything can move. A namespace moves to another cell with no change of protocol.
  7. Layers that stand alone. Each layer is a crate that another program can use alone. The core has no tenant.
  8. Every role is a pure actor. A deterministic step, persist before send, and I/O only in adapters.
  9. Proved before built. No code before its TLA+ model, and no excuse in simulation.
  10. Everything simulates, and it runs in the browser. Every layer and the whole service run in the deterministic simulation, and the same code compiles to wasm.
  11. Easy to operate. The service operates itself: it heals and it scales with no person in the loop. What a person would do by hand, a component does.

The features of the first version stay. Its structure changes: the service becomes a stack of layers on the journal v1, and each layer is a crate with its own model and its own simulation (§4.4).

The stack

Eight layers. A layer depends only on the layers below it. Layers 0 to 5 are pure: no runtime, no I/O, and they build for wasm. Only layer 6 does I/O. The names of the crates still to build are Open.

Two joints hold the layers apart:

  • A booking becomes an Assign. The cell records where a role runs: a booking. On the machine, a booking becomes Input::Assign of the host, and a release becomes Input::Unassign. The journal never reads a booking. The part between the two is #1424. Machines.
  • A coordinator changes a journal only through fenced calls. It records each action in its own control journal before it does it. Each order carries its term and names the epoch of its target, and the target refuses an old one (§3.3, rule 3).One shape at every level.

The pages

The version before the rewrite

A first version ran: a daemon on each machine, a CLI, many cells, Biscuit tokens and a deterministic simulation with faults on. It showed where its foundations were too weak, so paros started again from the consensus core. The whole first version stays at the git tag v0.2.0-alpha.1: parosd, parosctl, paros-bench, the Docker Compose demo and the simulation. To run it:

git clone https://github.com/PierreZ/paros && cd paros
git checkout v0.2.0-alpha.1
docker compose up -d --build
docker compose run --rm init
docker compose run --rm parosctl tenant create acme

Its DEMO.md is the walk-through. A recap of each removed crate is in docs/archive/v0.2.0-alpha.1/.