skip to content
==> README.md <==
1# @ajax/mesh-jobs-merge
2
3How a new leader of the job table merges a majority's answers to its pull. Any two majorities meet,
4so the merge holds every committed entry without matching logs, and the order of application decides
5between two results of one item:
6
71. The committed tables are applied first, the latest commit point first.
82. Then the entries not committed yet are applied, the latest leadership's first.
9
10A committed result is therefore never overwritten by one that was not committed, and between
11uncommitted entries the later leadership's wins (review finding 5). `mj_answer` is one member's
12answer as it arrives in numbered parts. `mj_answer_of` builds the new leader's own answer from its
13replica.
14
15## Ported from
16
17[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT):
18`crates/mesh-host/src/jobs.rs`: `Answer` (`of`), `merge`.
19
20## Tests
21
22`tests/merge.c`: 100 random merges of up to four answers (committed tables at random commit points,
23entries of random leaderships, a later answer from the same member replacing an earlier one), each
24giving the same table as the Rust's (golden hashes from the Rust), and an answer built from a replica.
25
26## Licence
27
28MIT. See the repository's LICENSE.