skip to content
[readonly]

Job-table leadership ids (fleet term and count) and the lease ids each leadership hands out

sh
$ sexc add @ajax/mesh-jobs-lid
  • total 3
  • drwxr-xr-x-../
  • drwxr-xr-x-Oct 27 05:24v/# 1 version
  • drwxr-xr-x-Oct 27 05:24files/# the files of 0.1.0
latest
0.1.0, published Oct 27 05:24 by ajax
owners
ajax
license
MIT
dependencies
@ajax/mesh-check ^0.1.0
dependents
@ajax/mesh-jobd, @ajax/mesh-jobd-text, @ajax/mesh-jobs-node
keywords
mesh alphaos jobs leadership lease
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-jobs-lid
repository
https://github.com/thomasdavis/alpha-c-mesh
==> README.md <==
1# @ajax/mesh-jobs-lid
2
3The job table's leadership ids. A lid is the fleet term in its high 24 bits and a count below it.
4`mj_lid_next` picks one above every leadership a member has persisted, so a later leadership's lid
5is always larger, even within one term (a restarted coordinator, a leader that leads again), and
6never comes from a clock (review finding 10). `mj_lease_base` is the first lease id of a leadership,
7so two leaderships' leases never share an id. Header-only and freestanding.
8
9## Ported from
10
11[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT):
12`crates/mesh-host/src/jobs.rs`: `lid_term`, `lid_next`, `lease_base`.
13
14## Tests
15
16`tests/lid.c`: the checks in the Rust's `a_restarted_coordinator_with_its_clock_behind`, and the
1724-bit term limit.
18
19## Licence
20
21MIT. See the repository's LICENSE.