Composer: find the store by the holder of any of its names, the old seat's too (ADR 0632 §2; issue 1966)

While the indexer holds distribution's new manifest, every node reads main's,
which claims only mesh-artifact-store: a new engine must find the store there.

Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
2026-11-04 21:29:12 +01:00
parent e5d9753368
commit 570b66230c
3 changed files with 45 additions and 7 deletions
+30
View File
@@ -318,6 +318,36 @@ func TestTheStoreIsFoundByTheImageSeatsHolderAndItsListen(t *testing.T) {
t.Errorf("${seat:%s:reach} is %q", seat, r.SeatReach[seat])
}
}
// main's distribution, the manifest every node reads while the indexer holds the new one (ADR 0632 §2): it claims
// only mesh-artifact-store and serves the retired provision; the engine finds the store by that claim and its listen.
old := in
old.Catalogue = map[string]catalogue.Manifest{}
for k, v := range in.Catalogue {
if k != "registry" {
old.Catalogue[k] = v
}
}
old.Catalogue["distribution"] = catalogue.Manifest{Module: "distribution", Version: "2",
Provides: []catalogue.Offer{{Name: catalogue.ArtifactStoreProvision, Scope: catalogue.ScopeMesh}},
Claims: []catalogue.Claim{{Name: "mesh-artifact-store", Scope: catalogue.ScopeMesh}},
Serves: map[string]map[string]any{catalogue.ArtifactStoreProvision: {"port": 5000}},
Listens: []catalogue.Listening{{Name: "registry", Port: 5000, Protocol: "tcp", From: catalogue.FromMesh}}}
old.Nodes = append([]Node(nil), in.Nodes...)
for i := range old.Nodes {
if old.Nodes[i].Name == "anchor" {
var kept []string
for _, a := range old.Nodes[i].Assigned {
if a != "registry" && a != "old" {
kept = append(kept, a)
}
}
old.Nodes[i].Assigned = append(kept, "distribution")
old.Nodes[i].Ports = map[string]map[int]int{"distribution": {5000: 5400}}
}
}
if got := placed(t, old, "laptop").Rendering.ArtifactStore; got != "anchor.internal:5400" {
t.Errorf("main's distribution, claiming only mesh-artifact-store, is reached at %q, want anchor.internal:5400", got)
}
m := in.Catalogue["registry"]
m.Listens = append(m.Listens, catalogue.Listening{Name: "other", Port: 5300, From: catalogue.FromMesh})
in.Catalogue["registry"] = m