skip to content
[readonly]

A new job-table leader's merge of a majority's answers: committed tables first, then uncommitted entries, the latest leadership's first

sh
$ sexc add @ajax/mesh-jobs-merge
  • 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, @ajax/mesh-omap ^0.1.0, @ajax/mesh-jobs-op ^0.1.0, @ajax/mesh-jobs-table ^0.1.0, @ajax/mesh-jobs-log ^0.1.0
dependents
@ajax/mesh-jobs-node
keywords
mesh alphaos jobs merge election raft
homepage
https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-jobs-merge
repository
https://github.com/thomasdavis/alpha-c-mesh
==> 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.