The rest of the mesh resolves each machine with its pins and names what it leaves out; a built-by edge never widens a plan; plans stop #199
@@ -7,6 +7,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -281,8 +282,9 @@ func theRestOfTheMesh(ctx context.Context, inv *inventory.Inventory,
|
|||||||
for _, o := range others {
|
for _, o := range others {
|
||||||
got, err := catalogue.Resolve(shelf, o.assigned, o.node, catalogue.World{Unchecked: true, Holdings: holdings})
|
got, err := catalogue.Resolve(shelf, o.assigned, o.node, catalogue.World{Unchecked: true, Holdings: holdings})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Their set does not resolve for some other reason. Not this node's problem to
|
// Said, not skipped: a machine dropped here offers nothing and holds nothing as far
|
||||||
// report, and nothing of theirs is running, so it offers nothing.
|
// as every other machine's plan can tell (novox/hq issue 188).
|
||||||
|
fmt.Fprintf(os.Stderr, "%s is left out of the rest of the mesh: it does not resolve: %v\n", o.node.Name, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
firstHeld = append(firstHeld, got.Claims...)
|
firstHeld = append(firstHeld, got.Claims...)
|
||||||
@@ -313,8 +315,17 @@ func theRestOfTheMesh(ctx context.Context, inv *inventory.Inventory,
|
|||||||
world := catalogue.World{Offered: offered, Held: firstHeld, Holdings: holdings}
|
world := catalogue.World{Offered: offered, Held: firstHeld, Holdings: holdings}
|
||||||
var held []catalogue.Held
|
var held []catalogue.Held
|
||||||
for _, o := range others {
|
for _, o := range others {
|
||||||
got, err := catalogue.Resolve(shelf, o.assigned, o.node, world)
|
// Each machine is resolved with its own pins, as its plan is: a machine that needs one to
|
||||||
|
// settle two providers would otherwise be refused here and vanish from the mesh — every
|
||||||
|
// seat it holds unheld, every build that needs one refused (2026-10-01, the control node;
|
||||||
|
// novox/hq issue 188).
|
||||||
|
theirs := world
|
||||||
|
if pins, err := inv.PinsFor(ctx, o.node.Name); err == nil {
|
||||||
|
theirs.Pinned = pins
|
||||||
|
}
|
||||||
|
got, err := catalogue.Resolve(shelf, o.assigned, o.node, theirs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "%s is left out of the rest of the mesh: it does not resolve: %v\n", o.node.Name, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
held = append(held, got.Claims...)
|
held = append(held, got.Claims...)
|
||||||
|
|||||||
Reference in New Issue
Block a user