H-A-180: judge a restore point's hold again at the start and on placement changes

A module held because the recovery module could not be asked kept that hold
across the engine's start as if it waited for the operator's answer, while
its have carried a wait, so the assigner never raised that ask: the hold was
for good (the indexer on the control-node). The engine now judges such a hold
again at its start and at every change of the placements: with no holder of
mesh-recovery placed it moves the module without a point (H-A-177), with one
placed it asks the point once more. A point a holder answered and failed is
held as a failed backup, with no wait, so the assigner raises the operator's
ask (back up again or skip); an older hold of that kind written with a wait
is written again without one at the start.

Builds: design 47 H-A-180, H-A-177, ADR 0568 §4, G-14 (a snapshot-kept that ends failed holds as a failed backup), A-453
This commit is contained in:
2026-11-20 19:31:31 +01:00
parent 1b4ce3ebf6
commit 891df501a7
7 changed files with 196 additions and 27 deletions
+6
View File
@@ -172,6 +172,9 @@ type Composer struct {
// OnEngine is told the node-engine's own module each time a composing finds it (design 47 G §527, §634); set before the
// composer runs.
OnEngine func(module string)
// OnPlacements is told each change of a node's assignment the composer takes in, so the agent judges again a module held
// because the recovery module could not be asked (design 47 H, H-A-180); set before Watch, nil tells nothing.
OnPlacements func()
// AlsoEntryAgain is told each entry asked again by hand, so the shadow's own cache of entries asks it again too.
AlsoEntryAgain func(ctx context.Context, fp string)
// AlsoEntriesAskAgain is told each catalog-revision the composer hears, so the shadow, which hears nothing itself, asks its
@@ -904,6 +907,9 @@ func (c *Composer) takeAssignments(u agent.Update) {
if node != "" && err != nil && c.env.Say != nil {
c.env.Say("the seat's assignment of " + node + ": " + err.Error())
}
if node != "" && c.OnPlacements != nil {
c.OnPlacements()
}
}
func (c *Composer) takeRecord(u agent.Update) {
+5
View File
@@ -261,6 +261,8 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
var composed atomic.Int64 // passes made: each reads what runs once
env.Running = func() []compositions.Composed { composed.Add(1); return nil }
c := New(env)
var placements atomic.Int64 // H-A-180: each assignment taken in is told, so the agent judges a recovery hold again
c.OnPlacements = func() { placements.Add(1) }
out, err := c.Watch(ctx, "n1.>")
if err != nil {
t.Fatal(err)
@@ -301,6 +303,9 @@ func TestTheNodeComposesItsWantsFromTheBus(t *testing.T) {
if placed, read := c.RecoveryPlaced(); !read || placed {
t.Errorf("once the assignments are caught up RecoveryPlaced answers placed %v read %v, want read with no holder", placed, read)
}
if placements.Load() == 0 {
t.Error("the assignment taken in was not told to OnPlacements (H-A-180)")
}
break
}
c, err := compositions.Decode(u.Value)