1# @ajax/mesh-reconcile
23The fleet reconciler: makes this member's programs match the committed desired state, on every commit
4and when the member (re)joins (it is the only thing that changes the program set in a fleet). One pass:
561. the plan (`@ajax/mesh-fleet-plan`): unloads, loads, upgrades (or rollbacks), run states and resets.
7 A program this member has no image for is reported *unsupported*, not failed; a failure is skipped
8 at that hash until the 30 s retry or the next document. Programs migrating here are loaded stopped,
9 take their views from the source (producers first) and start (consumers first), and the move's
10 outcome (with its gap) goes out on the beat;
112. the lockstep group: a new epoch quiesces, sets the group words, resets and HELLOs; a cycle within
12 the epoch quiesces with rounds mirrored and HELLOs only with the document's image and the cycle's
13 task done here (review finding 2), never re-running a task that failed;
143. on the leader, the placement requests (one dropped from the document goes back to local).
1516Everything that touches the driver, the mailbox and the fleet thread goes through `mrc_ops`, which the
17daemon wires. `mrc_thread_start` runs it on its own thread (post documents; failures retried after
1830 s).
1920## Ported from
2122[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) `crates/mesh-host/src/reconcile.rs`:
23`run`, `Rec` (`pass`, `act`, `migrate`, `fetch_view`, `quiesce`, `set_group_words`, `ready`, `group`,
24`place`, `status`), `cycle_ready`, `image_ready`.
2526## Tests
2728`tests/reconcile.c`: the Rust's `a_cycle_is_hellod_only_with_its_image_and_task`, and passes against a
29fake driver: loads, an upgrade, an unload, an unsupported program, a failure skipped and retried, a
30migration in the right order, a lockstep epoch and a task cycle, a paused group, placement on the leader.
3132## Licence
3334MIT. See the repository's LICENSE.