The mesh knows who is out of touch
09-the-node-lifecycle asks for this in as many words -- *how long it has been disconnected is a fact the mesh must hold, and nothing holds it today. Without it, a node running last month's assignments looks exactly like one that is current.* Now it holds it. `node list` says "here", "out of touch 4m", or "never spoken", and the third is kept distinct from the second on purpose: a node that has never spoken did not finish joining, and a node last heard from a month ago is running a month-old picture of the mesh. Those need different responses from a person. A bare word that a node is there moves last_seen and touches nothing else. It is not an account of what the machine holds, and recording it as one would replace the recovery copy with an empty list every minute -- so a rebuilding node would then be told it owns nothing and remove whatever it found. There is a test for exactly that. Heard is silent in the log. A node saying it is there every minute would fill the log with the ordinary case, and a log where the ordinary case is loud is a log nobody reads. Verified in the lab across the threshold, both directions.
This commit is contained in:
@@ -17,6 +17,7 @@ const ControlQueue = "control"
|
||||
const (
|
||||
KeyEnrol = "enrol"
|
||||
KeyReport = "report"
|
||||
KeyAlive = "alive"
|
||||
)
|
||||
|
||||
// QueueFor is the queue a node consumes from — the only one it may read.
|
||||
@@ -59,6 +60,15 @@ type Signed struct {
|
||||
Signature []byte `json:"signature"`
|
||||
}
|
||||
|
||||
// Alive is a node saying nothing except that it is there.
|
||||
//
|
||||
// How long a node has been out of touch is a fact only the mesh can hold — nobody else is
|
||||
// watching — and without it a node running last month's assignments looks exactly like one that
|
||||
// is current.
|
||||
type Alive struct {
|
||||
Node string `json:"node"`
|
||||
}
|
||||
|
||||
// Report is what a node states after applying. It states; the owning context writes.
|
||||
type Report struct {
|
||||
Node string `json:"node"`
|
||||
|
||||
Reference in New Issue
Block a user