H-A-177: move a data module without its restore point where no recovery holder is placed

The node-engine held every data-holding module's take-in for good: it asked
the seat mesh-recovery for the restore point, and nothing answers because
no holder of the seat is placed on the mesh (H §456). It now asks only where
the assigner's placements it holds name a holder (and while they are not
read yet); where none is placed it moves the module without a point and
raises the finding restore-point-missing (warning, scope machine, id the
module), cleared at the module's next take-in that takes its point. A holder
placed that does not answer still holds the move.

Builds: design 47 H §456, H-A-177
This commit is contained in:
2026-11-20 18:56:43 +01:00
parent b877d36f6f
commit d217056cf7
9 changed files with 179 additions and 1 deletions
+20
View File
@@ -15,6 +15,7 @@ import (
"sync"
"time"
"git.novox.be/novox/mesh-contracts/go/seats/meshrecovery"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
@@ -577,6 +578,25 @@ func (c *Composer) needsAddressOf(node, module string) bool {
return false
}
// RecoveryPlaced says whether the assigner's placements this composer holds name a holder of the seat mesh-recovery on any node of
// the mesh, and whether they are read yet: the watch of the seat's assignments has caught up (design 47 H, H-A-177, H §456).
func (c *Composer) RecoveryPlaced() (placed, read bool) {
read = c.assignmentsRead.Load()
c.mu.Lock()
defer c.mu.Unlock()
for _, p := range c.assignments {
for _, h := range p.Holds {
if h.Claim == meshrecovery.Seat {
return true, read
}
if s, ok := catalogue.SeatNamed(h.Claim); ok && s.Name == meshrecovery.Seat {
return true, read
}
}
}
return false, read
}
// askTrunkBuilds asks, for each module another node runs at a build with no entry and whose placement names no build, the trunk
// build by the seat's verb `module`, once per running build (A-461b). Called before the lock is taken: the verb is a call.
func (c *Composer) askTrunkBuilds() (wait func()) {
+19
View File
@@ -666,6 +666,25 @@ func TestOnlyWhatTheNodeNeedsOfAnotherNodesPlacementIsAsked(t *testing.T) {
if len(asked) != 2 || asked["distribution"] != 1 || asked["provider"] != 1 {
t.Errorf("the trunk builds asked are %v, want the store's holder and the bound provider alone", asked)
}
// Design 47 H, H-A-177: the same placements say whether a holder of the seat mesh-recovery is placed on any node, and whether
// they are read yet.
t.Run("a holder of mesh-recovery is placed where any node's placement holds the seat (H-A-177)", func(t *testing.T) {
if placed, read := c.RecoveryPlaced(); placed || read {
t.Fatalf("placed %v read %v, want neither before the watch caught up and with no holder", placed, read)
}
c.assignmentsRead.Store(true)
if placed, read := c.RecoveryPlaced(); placed || !read {
t.Fatalf("placed %v read %v, want no holder read", placed, read)
}
c.mu.Lock()
p := c.assignments["n2"]
p.Holds = append(p.Holds, meshmoduleassigner.Holding{Claim: "mesh-recovery", Module: "mesh-recovery", Scope: "mesh"})
c.assignments["n2"] = p
c.mu.Unlock()
if placed, read := c.RecoveryPlaced(); !placed || !read {
t.Fatalf("placed %v read %v, want the holder on n2", placed, read)
}
})
}
// A-487a (A-461e): a trunk build the catalog gave none of is not asked again at every pass: it waits laterAgain's step for the module
+6
View File
@@ -287,6 +287,9 @@ type Composer struct {
passing atomic.Bool
// early is true while the early pass of a start runs (design 47 G §683, A-117).
early atomic.Bool
// assignmentsRead is set once the watch of the seat's assignments has caught up: from then the placements this composer holds
// are the mesh's (RecoveryPlaced, design 47 H, H-A-177).
assignmentsRead atomic.Bool
// last is how the last pass went, under mu.
last Pass
// watching says the composer's loop runs (Watch), so an ask of a pass can be answered.
@@ -656,6 +659,9 @@ func (c *Composer) Watch(ctx context.Context, _ string) (<-chan agent.Update, er
dirty = true // a secret changed: its new generation is asked of the vault at the compose
case t.u.Caught:
caught[t.in] = true
if ins[t.in].bucket == buckets.Assignments {
c.assignmentsRead.Store(true)
}
if ins[t.in].bucket == buckets.Wants {
c.endKeptWants() // the wants the seat says now are the ones composed from (§683)
}