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:
@@ -3,6 +3,7 @@ package compose
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@@ -332,11 +333,18 @@ func (c *composer) namesInTheMesh() map[string]string {
|
||||
const StoreSeat = "container-image-registry"
|
||||
|
||||
// storeHolders are the modules holding the store's seat: the holdings on record, and only where none is on record every
|
||||
// module of the catalogue claiming it at the mesh's scope, as a seat holder's reach is read (replicatedHolders).
|
||||
// module of the catalogue claiming it at the mesh's scope, as a seat holder's reach is read (replicatedHolders). Any name
|
||||
// of the store counts (resolution.StoreSeats): until every counted engine states the new reading, the manifest every
|
||||
// node reads is the holder's old one, which claims only mesh-artifact-store (ADR 0632 §2), and an engine that finds the
|
||||
// store by the seat must find it there too.
|
||||
func (c *composer) storeHolders() map[string]catalogue.Manifest {
|
||||
isStore := func(claim string) bool {
|
||||
hs, ok := catalogue.SeatNamed(claim)
|
||||
return ok && slices.Contains(resolution.StoreSeats, hs.Name)
|
||||
}
|
||||
out := map[string]catalogue.Manifest{}
|
||||
for _, h := range c.in.Holdings {
|
||||
if hs, ok := catalogue.SeatNamed(h.Claim); ok && hs.Name == StoreSeat && h.Scope == catalogue.ScopeMesh && h.Module != "" {
|
||||
if isStore(h.Claim) && h.Scope == catalogue.ScopeMesh && h.Module != "" {
|
||||
if m, known := c.in.Catalogue[h.Module]; known {
|
||||
out[h.Module] = m
|
||||
}
|
||||
@@ -347,7 +355,7 @@ func (c *composer) storeHolders() map[string]catalogue.Manifest {
|
||||
}
|
||||
for name, m := range c.in.Catalogue {
|
||||
for _, cl := range m.Claims {
|
||||
if cs, ok := catalogue.SeatNamed(cl.Name); ok && cs.Name == StoreSeat && cl.At() == catalogue.ScopeMesh {
|
||||
if isStore(cl.Name) && cl.At() == catalogue.ScopeMesh {
|
||||
out[name] = m
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user