| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Two nodes of both kinds say an Automerge document in their handshakes,
and synced that alone: what only sets hold, the entries of the nodes on
sets, stopped at the first node of both it reached, so that in a swarm
larger than its neighbour count the nodes on sets never came to read
each other's entries. A node of both now says where its set stands
beside each STATUS to a peer on a document; one of both that hears it
passes its set on in turn, one on the document alone drops it.
A simulation of nine nodes, three of each kind, two neighbours each.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
pins
A pin counted only while the node had no file of its set, so a node
behind for longer than the others keep what a checkpoint forgot, or one
undoing a move, had to start without its file, and lost what it refused
of its own and what its operator had it drop. The file now says which
checkpoint was pinned when the set began: with another pinned, and not
the one the store is at, the node gathers its set anew from that one,
its store refusing what the one in the file refused. A node of both
kinds makes its set of its document then, where it finds the pin.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With store-document, store-both has the node hold its store in the
Automerge document too, and sync with nodes of either kind:
* it says to each peer the kind that peer holds, and passes its set on
to those that hold sets (swarm::set::holds_a_set), the Automerge
document to the others;
* what its set takes of the document goes on to the peers on sets
(Holding::unpassed), and what its set takes of them is put into the
document, as events it lacks are (Holding::lacking);
* its entry in the document is put as its entry in the set
(swarm::set::mirror_entry), and it reads the members of both;
* without the set's file yet, its set is made of the store as it reads
it of its document, with what store-file kept of its own.
A simulation: two nodes on the Automerge document, one on a set, one
of both between them; an event put on either side reaches all four.
|
| |
|
|
|
|
|
|
| |
What a set hands the node to read was read in the document's place;
it is read over it now (view::Listed): at a path, what the set's tree
holds, else what the document does, and maps of both as one. A node on
a set alone reads the same as before, its document being empty; one
holding its store in both, to come, reads the members of both.
|
| |
|
|
|
|
|
|
|
| |
A node holds one kind of document, or, to come, its store in both
(Holding::kinds, of_both). The kind a peer's handshakes say is kept with
the peer, where the node holds it too, and is what the node says to it
in turn; to a peer that said none yet, a node of more than one kind
says each in turn, HELLO by HELLO, until one is answered. A node of one
kind says and takes that one, as before.
|
| |
|
|
|
|
|
|
| |
What a node speaks is mostly known a moment after it proved where it
is, and its HELLO goes as it proves: one in the oldest version, which
can't say a kind other than Automerge's, didn't go. Such a seed is
tried again after a quarter of a second, four times, before the wait
that grows; it was five seconds each time a node on a set started.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Given store-id and store-document, no file yet and no root, or a
checkpoint pinned (store-checkpoint), a node starts with nothing of its
store (held::Begun::Start, passing::Start): it asks the members whose
handshake it took for the checkpoint named by the store's ID, its root,
or by the pin, then for the events that one keeps, each taken only as
what its name says; begins its set from them; and is ready, catching
up as any node behind. A set gives the checkpoint its store holds by
its name (passing::Unit::Checkpoint).
A simulation: a node given the ID alone joins two that hold a write.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With store-root or store-id, store-document names the file of the
store's own document, a set of events: the node holds its store there
and nothing in the Automerge document, syncs with nodes holding a set
and no others, and goes on from the file when started again. Without a
file yet it begins from the root (StoreStart::set); joining by the ID
alone needs a file. What a checkpoint forgot is kept for
store-keeps-forgotten (30 days). The file stands for store-file, and no
checkpoint is pinned.
The set is written to its file where it changed, every five seconds
with the store's worker and as the node stops (Holding::save), what a
checkpoint forgot longer ago let go of first.
Simulations: a node behind catches up; a node goes on from its file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Such a node (Holding::carrying) holds an Automerge document with
nothing in it, which nothing passes on, and its set is its document:
* swarm::set passes the set on. Where it stands goes in the node's
STATUSes as another kind's stamp, and a peer's is given to the set;
what the set says besides goes as a SYNC's body; what the set took, of
a peer or of the node itself, goes on to the node's other neighbours.
What compares stamps for an Automerge document's sake is handed the
node's own, and finds nothing to do; the Automerge sync isn't begun.
* The node writes its own entry (AppState::mutate_set): what writes
protocol data through a view writes to the members' entries as a
tree, and what the node's own reads as after is put as its next
entry, signed and passed on. Anything else is refused, and so is a
write to an Automerge document as such.
* An event the node writes (held::write) is offered to the set and
passed on; a set lacks nothing of its store to put again.
* The node's swarm is its store's, said at its start.
A simulation: three such nodes of two parties register, and each
holds the others' entries; events put on two of them reach all three,
and they come to stand alike, the documents they hold beside empty.
|
| |
|
|
|
|
|
|
|
|
|
| |
The swarm reads its members, their addresses, aliases, parties, tiers
and links, at _continuum/members of the document the node holds. Where
the node's document keeps them apart and hands them over as a tree
(AppState::entries: a set of events, Holding::entries), they are read
of that (view::members_of): by the topology, the node's registration,
stability, working links, the state file's seeds, reach, and the API's
aliases, dashboards and tier. No node's document does so yet but one
whose store a set carries, which none starts as.
|
| |
|
|
|
|
| |
Its failing was logged as retried, and nothing retried it: a node that
is no neighbour yet gets no HELLO again from the peer worker. The seed
now stays with those still to reach, tried again as they are.
|
| |
|
|
|
|
| |
In its handshakes, and checks a peer's against it (AppState::kind): a
set of events where one carries its store (Holding::of_a_set), else
Automerge's, as it was for every node.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
From version 53 on, beside Automerge's (SyncBody::Kind,
HeadsSummary::Kind): a SYNC's body is one more of its shapes, another
kind's bytes; a STATUS's stamp is another kind's bytes after a byte no
Automerge stamp begins with. Nothing version 53 said changes, and
version 52 says neither (WireError::OtherKind). Two stamps of another
kind are the same where their bytes are.
A node holding an Automerge document passes over a body of another
kind: a peer holding one isn't let near it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Spoken beside 52 (OLDEST), so a swarm upgrades node by node: a node
writes each peer the newest version both speak.
From 53 on (wire::KINDS, wire::kinds), what is a document's kind's goes
as bytes the wire carries and doesn't read: a SYNC's body, with whether
it is taken as delivered, and what vouches for what it carries; where a
STATUS says its sender stands; what a BLOB request asks for in bulk; a
BLOB is of a unit or of what is offered in bulk, by their names.
Automerge's bytes are what 52 carries in the messages' own fields.
HELLO and HELLO_REPLY say the kind of the sender's document
(document::KIND, automerge) from 53 on; one in 52 says none and is of
that kind. A peer whose document is of another kind is refused in the
handshake, saying so.
The bytes of 52 stay as golden_bytes has them; golden_bytes_of_kinds has
those of 53. scripts/wire-check v0.0.1: its nodes and this tree's talk.
|
| |
|
|
|
|
|
|
|
|
| |
document::passing: a Mark, where a document stood, by which what
changed since and the node's own units since are told (changed_since,
own_since: the change publisher, the sync worker); and of where a peer
says it stands, what the document lacks, whether the peer holds what
the document held, a pull of what is lacking, and what it has counting
as sent no more (lacking, peer_holds, pull, heard: the relay,
keepalives). The published stamp gives its summary and its mark.
|
| |
|
|
|
|
|
|
|
| |
document::UnitId: the name of a unit of a document as its kind has it,
an Automerge change's hash. What the swarm announces, forwards along
trees, tells a peer it refused and drops is named so (the
dissemination, relay, refusals, AppState::drop_taken), and the session
is told so what a peer gets from another; a change's hash it is where
the document is asked, and on the wire.
|
| |
|
|
|
|
|
| |
document::passing::take_bulk: the changes a peer offered as a blob,
fetched, judged and applied with their signatures, and all the heads
offered held after. swarm::sync keeps the fetch, the epoch check, and
what is counted and noted of the peer.
|
| |
|
|
|
|
|
|
|
|
|
| |
document's
document::passing: received (a message read, inflated where it was
deflated), take (the changes it carries screened and applied, the rest
given to the session) and settle (what the peer lacks asked for again,
the signatures waiting offered, whether an answer is due, what came and
whose). swarm::sync keeps the epoch check, what is noted of the peer,
the wait for its answer, the throughput, and what is counted.
|
| |
|
|
|
|
|
|
|
| |
document::passing::next: the next message for a peer, by the session
with it: changes as they are along a tree, a sync message, or an offer
of the changes as a blob where a message would be too large, with the
signatures of what it carries, and whether it is taken as delivered.
swarm::sync keeps whose tree a message is along, the epoch it is of,
the envelope, and what is counted of it.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
AppState::mutate_doc, mutate_doc_registering and mutate_doc_by hand what
they are given a document::view::Write: the member registry, the users,
sessions, forgetting and bootstrap write through them, and take whatever
kind of document gives it. AppState::mutate_doc_for is for what asks
more of an Automerge document than values at paths (the store's API, a
remake's host, a store's events), and gives the heads after the write.
What reads a view takes one of any size (dyn Write among them).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
document::view: Read (the value at a path, plain, typed, a map's keys)
and Write (a value written, one deleted), which Automerge's documents,
writes in progress and documents as they were all are. The member
registry, the users, access control's reads and rules, the topology,
forgetting and bootstrap read and write through them, and name neither
Automerge's ReadDoc and Transactable nor document::store, which is what
an Automerge document can do beyond.
How a swarm holding a store judges what a change writes is handed to
the rules (rules::judge_seen), being its kind of document's to say.
|
| |
|
|
|
|
|
|
|
| |
control's
access::screen becomes document::screen: reading received bytes as
changes, putting them in order, keeping those that wait or are refused,
vouching by signatures and applying is all Automerge's shape, and has
each change judged by the rules (access::rules) before it applies it.
|
| |
|
|
|
|
|
|
|
| |
The actors a node writes or wrote with in its current document
(document::own::OwnWriters, AppState::own_writers) were kept by the
remake state, which signing, the document file, sync and a dropped
change read them from. They are the engine's: a document of a kind
without writers of this sort has none, and needs no remake state for
them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
ASK_FOR (20 s), REFUSED_FOR (60 s), ONE_SHORT_EVERY (300 s) and
REAFFIRM_EVERY (60 s) were fixed: the simulations, on a 250 ms
keepalive, sat them out in real time, and simtest::hyparview's two took
a minute each, most of cargo sim's.
Now Timing has them (ask_for, refused_for, one_short_every,
reaffirm_every): twice the first sync reply timeout, one keepalive
interval, five, and one. At the defaults (1m, 10 s) they are what they
were; with another --keepalive they scale with it, as the keepalives
they answer to do. The two simulations take 3 s.
|
| |
|
|
|
|
|
|
|
|
|
| |
A seed that named no root, joining itself, names it once ready, but only
from this build on: a 0.0.1 seed never shakes hands again, and its joiner
waited for ever. scripts/wire-check hit that, d of this tree joining
through c of 0.0.1, their handshake 6 ms before c was ready.
So the joiner does its half too: where a seed it still waits for named
none, a STATUS saying the seed became ready has it shake hands with the
seed again (seed_ready), which then names its root.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A joiner takes no root before each of its seeds named one, and a seed
names its root only in a handshake. A seed that shook hands while
joining itself named none, and never again: its joiner waited for ever.
scripts/wire-check hit that (b joining a, c through b, d through c):
b's reply to c came 2 ms before b had its document.
Now a node notes the peers its handshakes named no root to, and once
ready, shakes hands with them again, naming it. Older joiners take it
too: it's a handshake as before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a sync
A node that stopped cleanly writes on as the writer of before, as
`--keep-actor` had it, now by default: an epoch gathers a writer per node
and per crash, drop or rejoin, not per start. `keep-actor = false`, in a
configuration file, has a node write as a fresh writer each start; a
node without a document file has nothing to keep, which is no longer an
error.
Writing on as the writer of before, a node holds its writes (`mutate_doc`
and the API's through it) until it synced once with a ready neighbour,
level with it, or 10 seconds passed (`AppState::hold_writes`,
`KEPT_WRITER_WAIT`): a neighbour holding later changes of that writer,
which a copy of the node's files made (a backup restored, a disk rolled
back), hands them over first, and the node takes a fresh writer then, as
it did. A node that reaches no neighbour within the wait writes on.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GET /peers shows, of each peer, what it said with its handshakes
(SPEAKS): its `knows`, the wire versions it speaks, the oldest and the
newest, and the newest revision of the federation it knows; null where
it said nothing, a build from before SPEAKS or no handshake from it
since the node started. `localKnows` is the node's own. So every swarm,
federated or not, shows which builds its nodes run, as far as each
heard.
`swarm::speaking::shown` shapes it, for GET /events/counts too, whose
`knows` is the same; docs/openapi.yaml has it once, as `Knows`. Without
the federation feature, a revision reads as one this continuum doesn't
know. `Speaking::of` is now used in every build, not only federated
ones, which warned of it as dead code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`GET /events/counts` says, of each node a party lists, what it said it
speaks and knows (`knows`, by node ID): the wire versions, the oldest and
the newest, and the newest revision of the federation it knows, by
number and ID and as people read it, its number null where this
continuum doesn't know it; null where it said nothing, a build from
before SPEAKS or one the node didn't hear from; the node's own as it is.
So the nodes still to upgrade before a revision passes show, every
party's, where before a party's operators could check only their own.
A party's client, backing a proposal that moves to another revision,
warns of every node of any party not known to know it, a line a party
naming each and what it said: once it passes, those stop at it till
upgraded. `next` warns alike, of the revision it moves to, or of the
later one it suggests. A warning, not a refusal: what a node heard is
no proof, and a node not heard from may well be upgraded.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before each HELLO and each HELLO_REPLY, a node sends SPEAKS: the oldest
and the newest wire version it speaks, and the ID of the newest revision
of the federation it knows. It stands outside the wire versions, its
first byte 0, which no version is, laid out as no build changes: that
byte, the oldest, the newest, then 32 bytes of the revision's ID where
there is one; a reader takes those and leaves whatever follows, which a
later build may add. So a peer on another build reads it too, and
nodes on different builds can say what they run, which a rollout needs.
A build from before it takes it for a message of another wire version
and logs that once of the peer (version=0), reading the rest of the
peer's messages as before: SPEAKS rolls out node by node, with no change
of VERSION. The node keeps what each peer said last (`swarm::speaking`,
at most 4096 peers). It counts as `hello` traffic.
`OLDEST`, the oldest version this build reads, is `VERSION` for now: a
range for a later build to widen.
operations.md also says what is so of the other-version warning now:
every transport logs it once per peer at warn, not Mycelium alone.
|
| |
|
|
|
|
|
| |
`scratch_dir` gives a guard (`Scratch`) that removes the directory with
all it holds when dropped, the test passing or failing. Each test keeps
it for as long as it uses the directory; the dashboard's browser check
writes its page into one.
|
| |
|
|
|
|
|
|
|
|
| |
Screening keeps a change whose dependencies haven't come from Automerge,
waiting, so Automerge never learns what it lacks: our next message asks for
the peer's heads alone, and the peer, forgetting having sent those, sends
them again, and what they build on only as far as it still counts it as
sent. So the session asks for what changes waiting build on and the
document lacks too (`Waiting::lacking`, `SyncSession::lacks`), as Automerge
asks for what the changes it holds back lack.
|
| |
|
|
|
|
|
|
|
| |
A node starting from a document, or as a swarm's genesis node, is ready at once, and
says HELLO to its seeds, members of its swarm that may be running. A seed that didn't
resolve then (the node, or the seed, not reachable yet) was tried no more, and a node
whose document names no member to reach, as one started from a store's root, stayed
alone. Now such seeds are tried again in the background, backing off as a joining node
does, until they resolve or the node stops.
|
| |
|
|
|
|
|
|
|
|
| |
In a swarm holding a store, a node reads a peer's messages only by the party its
handshake named. One whose handshake it hasn't taken (its reply lost, say) was cut off
at its next message, as a non-member is, while the peer, which took ours, synced on, and
neither said HELLO again. Now such a message goes unread, and the node says HELLO to the
peer, as to any whose reply it waits for (`hello_again_now`): its reply names its party.
What a peer refused as a non-member sends next is known to be a non-member's, its party
kept, so that it asks for no HELLO. A simulation loses a's replies to b for a while.
|
| |
|
|
|
|
|
|
|
|
| |
`federation::fork`: a node holding a federation's history makes the root of a fork at
heads it holds by a version, with the events the root keeps, as the file the fork's
founders start its swarm from (`make`, `root_file`, which `--store-root` reads); and
checks a fork's root it is given (`check`): whether it builds that root at its heads,
byte for byte, what it holds that those heads lack, and, party by party, the keys the
fork's version gives where they aren't those the party had there. The attack rows 35
and 36 have their tests.
|
| |
|
|
|
|
|
| |
The file `--store-root` names holds the store's root on its first line, and, for a
fork, the events the root keeps, each on a line of its own (JCS writes no line break).
The node checks that the federation takes them as a store's root with what it keeps,
and starts from the changes founding the swarm, built from them.
|
| |
|
|
|
|
|
|
|
|
|
| |
it keeps
A fork's root keeps events (`docs/store.md`, On Automerge): they follow its genesis
change in changes of the same writer, built the same way, filled in the order of their
IDs, events going into a change until their bytes there reach 1 MiB, the next event
beginning the next change (`events::founding`). A swarm holding a store starts from all
of them (`events::started`, given the events the root keeps; none for a federation's
root).
|
| |
|
|
|
|
|
|
|
|
| |
named
A node of a swarm holding a store keeps some of its neighbours among the members of its
own party and of the parties its operator names (`--store-neighbour-parties`), so that a
party listing many nodes can't be all of them (`docs/store.md`, Members): its neighbours
by the shared graph among those members alone, each as its entry names it, which every
node of its party computes alike, with those among all members.
|
| |
|
|
|
|
|
| |
In a swarm holding a store, a node computes its neighbours, and the member list's graph
writers' trees are built on, from the members its store names, each with the party its
entry names (`docs/store.md`, Members): the other entries name nodes it doesn't sync
with. While it holds no store, from every entry, as elsewhere.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A node of a swarm holding a store syncs with its members only (`docs/store.md`,
Members): the nodes its store names, each with the party its handshakes name, as the
store reads now. A handshake from any other goes unanswered, and what the node had with
it ends, as with a banned node; so does what it had with a member at its next message,
once the store names it no more (`swarm::peer::members`). The party a handshake names is
kept with the peer. While a node holds no store yet, joining, it can't tell, and takes
everyone of its swarm: its seeds, which take it only where its party lists it.
A node says whether it is a member itself, as its store reads, when that changes.
|
| |
|
|
|
|
|
| |
In a swarm holding a store, a node's handshakes name the party it is of (`docs/store.md`,
Members), so that a peer tells whether it is a member before its entry reaches it: HELLO
and HELLO_REPLY carry `party`, as `--store-party` says, None elsewhere and without the
`federation` feature. Wire format version 52.
|
| |
|
|
|
|
|
| |
In a swarm holding a store, a node's own entry names the party it is of (`docs/store.md`,
Members): `party`, as `--store-party` says, written at registration and kept so when it
changes over a restart, as the alias is; `members::party` reads it. Behind the
`federation` feature.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Behind the `federation` feature, two options:
* `--store-root PATH` starts a swarm holding a store, or goes on with one, from the
store's root, as bytes in the file, which the federation must take as a root. With no
document to start on, the node builds the genesis change from it, as every node given
the root does, and is ready at once; a document to start on must be of the root's
swarm.
* `--store-id ID` joins one through seeds by its ID, the root's SHA-256 in hex. An empty
document of the first epoch takes as its root only that store's genesis change, built
again from the root it holds (`document::events::is_genesis`), whatever peers name:
the root pin doesn't wait for seeds, nor is disputed.
Either names the swarm the node joins, which a state file must remember too, and can't
be combined with the other, nor with what makes a new swarm's first change (`--genesis`,
`--bootstrap-users`, `--bootstrap-keys`, `--bootstrap-policy`, `--remake`,
`--genesis-root`). The root is read as a file of its own kind (`store`), counted among
the node's files.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A swarm strict from its start had its policy written by its first user
in a later change. A change is judged by the policy at its history, so
any member could always add a change whose history is from before the
policy: judged by none, needing no signature, taken whenever it comes.
Since signed values are read by `seq`, an envelope planted there with
the highest `seq` there is can never be followed: a ban, a user, a
declaration, for good.
`--bootstrap-policy JSON`, with `--genesis`, records the policy in the
genesis change, with the first users: then no change of the swarm is
from before it. It must be a policy this node knows, and a strict one
needs `--bootstrap-keys`, or nobody could sign what decides who may do
what.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A neighbour pulls heads a STATUS listed only if it still lacks them after
a round trip to the sender, as they are usually on their way along a
writer's tree. With no round trip known, or one measured long ago (busy
pairs send no keepalives), it pulled at once; with a short one, a STATUS
sent right after a change can overtake it by more than that round trip,
delays varying per message. Either way the change came twice
(`trees_hold_through_continuous_writes`: c pulled once while every write
reached it along x's tree).
The wait is the round trip, but 50 ms at least (and 1 s at most, as
before).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A member one neighbour short asks once per `ONE_SHORT_EVERY` (300 s), and a
member with `k` refused it. When a member most others had as a neighbour
went away, three members ended up each with the other two as neighbours,
one short each; each asked once, was refused by a full member, and waited
five minutes. Changes pass only between neighbours: the three got none of
what was written meanwhile (`active_views_settle_and_heal`, timed out
waiting for the same heads).
NEIGHBOUR says now whether its sender is one short, and a member with `k`
takes such an ask as its `k + 1`th, the most it keeps; one with `k + 1`
still refuses. Asks stay as rare as they were, and one is enough but where
those asked have `k + 1`. Wire version 50.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A sync message larger than the threshold for its peer (16 chunks, lower
on a slow link or after a message to it failed whole) goes as a delta:
the peer fetches its changes in chunks, from any node holding them. Its
signatures, each writer's latest with changes in it, went in the
envelope offering it: up to 65536 of them, 6 MiB, in one message, the
size the delta exists to avoid. Nor did an Automerge message count its
signatures (one per writer in a whole document pulled) towards the
threshold.
A delta's signatures are now a blob of their own: the offerer packs and
keeps them (Blobs::keep, the latest 64), and the spec names them by
BLAKE3 hash and size (DeltaSpec::signatures, None where no signature
vouches for its changes). They are served as content (BlobId::Content),
so their hash checks them. The receiver fetches them from the offerer
alone, as another node holding the changes holds signatures of its own,
before the changes, and offers them under the write lock just before
judging the changes, so they wait for them as before. The envelope of a
delta carries none. An Automerge message's signatures count towards its
size: past the threshold, it goes as a delta.
Wire version 49.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With --keep-actor, a node on a document file that ends with a clean stop
writes on as the actor the file names. Two nodes started on copies of
one file (a copied data directory, a restored disk image while the
original runs) both do, and both make that actor's next change number:
peers holding one refuse the other as forged, and everything built on
it.
screen::apply_bytes, the way every received change comes in, now looks
for a change of the actor the node writes as that the node doesn't hold:
only another node can have made it. The node then writes on as a fresh
actor at once, logs a warning, and its callers add the actor to the
node's own (RemakeState::add_own_actor), which the document file's
header follows. The change is judged as any other. lifecycle.md says not
to start a copy of a node's data directory with --keep-actor, and what
the switch leaves: what both wrote before stays refused where the
other's came first.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With --keep-actor, a node on a file whose last record is Closed writes on
as the actor the header names, which takes the file holding every change
of that actor. At a clean stop, the node's own workers go on writing
until it exits: its alive stamp in the member list, votes, a
coordinator's commit. One committed after Closed was appended, and sent
by the still-running sync, would be a change of that actor the file
lacks, and the next start would make another change with its number.
swarm::document_file::close now takes the document's write lock, marks
the file at the heads it sees there, and sets a fresh actor before
letting go: what the node writes after is no change of the marked actor.
A record the file worker appends after Closed (such a write, flushed)
leaves the file unmarked, which starts a fresh actor next time.
|