1# @ajax/mesh-sched-tracker
23The fleet scheduler's rebalancer and the leader's moves. A program moves (`mst_step`) only when its best
4alternative scores `improve` (25 %) better than where it is, for `hold_ms` in a row, at least `dwell_ms`
5after its last move, one migration at a time and at most `per_min` a minute; an operator's pin moves it
6at once (with its view). The owner policy (`mst_owner`, HTCondor's) marks a member busy while other
7tenants load it, with hysteresis. A lockstep group is never moved: `mst_group_step` proposes a re-form.
8Moves live in the document (`mst_start_move`, `mst_end_move`), so a new leader takes over a migration
9the old one started (`mst_resume_moves`), and a move's verdict (`mst_mig_verdict`) is its own programs'
10outcomes on the target, not the target's whole reconcile pass.
1112## Ported from
1314[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) `crates/mesh-host/src/sched.rs`: `Move`,
15`Tracker` (`owner`, `recent`, `moved`, `step`, `group_step`), `unit`, `start_move`, `resume_moves`,
16`MigOutcome`, `mig_verdict`, `end_move`.
1718## Tests
1920`tests/tracker.c`: the Rust's `colocation_and_pins`, `hysteresis_and_budget`,
21`owner_policy_has_hysteresis`, `groups_are_proposed_not_moved`, `a_new_leader_takes_over_a_migration`,
22`the_moves_verdict_is_its_programs_not_the_whole_pass`, the scheduler's half of
23`a_pin_never_splits_a_colocated_pair`, and `simulation_is_stable_and_valid` (10 simulated minutes:
24members leave and return, the load oscillates; the placement stays valid and nothing flaps).
2526## Licence
2728MIT. See the repository's LICENSE.