A1: the assigner holds no want for a dependency's delivery
The version-delivered holds go whole: delivered.go (the delivery judgement, the delivery waits, the asks to say a version delivered again), the states delivery-waits and delivered-again, the tool assigner_delivered_again, the consumption of mesh-wants.version-delivered and assigner_release's step delivery. What it also heard and the want rule reads (version-released, machine-away, machine-back) stays, in releases.go. Builds: design 47 H §750, §764 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -97,7 +97,7 @@ func TestAnActingWaitOfANodeAwayStartsNoClockAndAnEntryWantedAlreadyWaitsNot(t *
|
||||
|
||||
func TestTheToolsReadAndReleaseAnActingWait(t *testing.T) {
|
||||
var acts []string
|
||||
s := newPutTools(memStore{waitsState: &memKV{values: map[string][]byte{}}, buckets.DeliveryWaitsState: &memKV{values: map[string][]byte{}}, buckets.DeliveredAgainState: &memKV{values: map[string][]byte{}}}, func(key string, body any) (json.RawMessage, error) {
|
||||
s := newPutTools(memStore{waitsState: &memKV{values: map[string][]byte{}}}, func(key string, body any) (json.RawMessage, error) {
|
||||
acts = append(acts, key)
|
||||
return json.RawMessage(`{"ok":true,"log":"logged"}`), nil
|
||||
})
|
||||
|
||||
@@ -1,454 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"slices"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go/jetstream"
|
||||
|
||||
wd "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshwatchdogs"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
"git.novox.be/novox/mesh-sdk/go/keys"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
|
||||
"mesh-delivery-assigner/internal/assign"
|
||||
"mesh-delivery-assigner/internal/assignment"
|
||||
"mesh-delivery-assigner/internal/buckets"
|
||||
)
|
||||
|
||||
// A delivery is waited for mesh-wide (design 47 G §376, §389, A-189, A-246). At its start the assigner reads whole, from their first
|
||||
// message, the streams of the catalog seat's version-released and of its own version-delivered (mesh-sdk process.FromFirst, A-233),
|
||||
// and the watchman's machine-away and machine-back, never its state; then it hears them. A released version of a module is said
|
||||
// version-delivered on the seat mesh-wants once, when every present machine placing it on the branch it is released from runs, healthy,
|
||||
// the want the assigner wrote naming that version; a version no present machine places is not delivered. A dependent whose want
|
||||
// changes fingerprint waits, by an edge of kind 2, 4 or 6, for its dependency's newest released version not yet said delivered, on
|
||||
// the branch it is released from; on another branch no version is released and nothing waits. The wait is said wait-held, step
|
||||
// delivery, bound 60 minutes from the version's release, kept in the state delivery-waits under the dependent's name, and said
|
||||
// wait-ended when the version is delivered (ran) or released by hand (assigner_release, released).
|
||||
|
||||
// deliveryWaitBound is a dependent's delivery wait's bound, from its dependency's version-released.
|
||||
const deliveryWaitBound = 60 * time.Minute
|
||||
|
||||
// Wait-ended's how of a delivery wait.
|
||||
const (
|
||||
deliveryWaitRan = "ran"
|
||||
deliveryWaitReleased = "released"
|
||||
)
|
||||
|
||||
// releaseHeard is one version-released heard: the version, each part's digest, the source revision and when it was said.
|
||||
type releaseHeard struct {
|
||||
Version string
|
||||
Parts map[string]string
|
||||
Source int64
|
||||
At time.Time
|
||||
}
|
||||
|
||||
// newestOf is the newest version of module released, the last heard of it in the stream's order.
|
||||
func (r *releasedVersions) newestOf(module string) (releaseHeard, bool) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
h, ok := r.newest[module]
|
||||
return h, ok
|
||||
}
|
||||
|
||||
// deliveredVersions are the version-delivered said, the assigner's own, by module and version: each is said once.
|
||||
type deliveredVersions struct {
|
||||
mu sync.Mutex
|
||||
said map[string]bool
|
||||
}
|
||||
|
||||
func (d *deliveredVersions) key(module, version string) string { return module + "@" + version }
|
||||
|
||||
// put takes one version-delivered in.
|
||||
func (d *deliveredVersions) put(data []byte) error {
|
||||
var e meshwants.VersionDeliveredEvent
|
||||
if err := json.Unmarshal(data, &e); err != nil {
|
||||
return fmt.Errorf("a version-delivered that is none: %w", err)
|
||||
}
|
||||
if e.Module == "" || e.Version == "" {
|
||||
return fmt.Errorf("a version-delivered naming no module or version: %s", data)
|
||||
}
|
||||
d.mark(e.Module, e.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *deliveredVersions) mark(module, version string) {
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
if d.said == nil {
|
||||
d.said = map[string]bool{}
|
||||
}
|
||||
d.said[d.key(module, version)] = true
|
||||
}
|
||||
|
||||
// has says whether version-delivered of module's version was said.
|
||||
func (d *deliveredVersions) has(module, version string) bool {
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
return d.said[d.key(module, version)]
|
||||
}
|
||||
|
||||
// presenceOf reads one machine-away or machine-back: the machine and when it was said.
|
||||
func presenceOf(data []byte) (string, time.Time, error) {
|
||||
var e wd.MachineAwayEvent // machine-back has the same fields
|
||||
if err := json.Unmarshal(data, &e); err != nil {
|
||||
return "", time.Time{}, err
|
||||
}
|
||||
if e.Machine == "" {
|
||||
return "", time.Time{}, fmt.Errorf("it names no machine: %s", data)
|
||||
}
|
||||
return e.Machine, e.At, nil
|
||||
}
|
||||
|
||||
// hearDelivery reads whole, then follows, the four streams a delivery is judged from: version-released, version-delivered,
|
||||
// machine-away and machine-back. A stream not heard is said as the assigner's finding, and what it carries is not known until
|
||||
// the assigner starts again.
|
||||
func hearDelivery(ctx context.Context, js jetstream.JetStream, w *world, wake func(), findings assign.Findings, logf func(string, ...any)) {
|
||||
acct := process.Account{Node: thisNode, Module: assignment.Module()}
|
||||
nh := notHeardWriter(findings, logf)
|
||||
for _, s := range []struct {
|
||||
stream, words string
|
||||
take func([]byte) error
|
||||
}{
|
||||
{meshcatalog.StreamVersionReleased, "no want names a released version and no delivery is judged", w.released.put},
|
||||
{meshwants.StreamVersionDelivered, "a version said delivered before is said again once it is judged", w.delivered.put},
|
||||
{wd.StreamMachineAway, "no machine is known away, so a delivery waits for a machine that is away", func(data []byte) error {
|
||||
m, at, err := presenceOf(data)
|
||||
if err == nil {
|
||||
w.heardPresence(m, true, at)
|
||||
logf("%s is away (machine-away): a composition step does not compose it until its machine-back", m)
|
||||
}
|
||||
return err
|
||||
}},
|
||||
{wd.StreamMachineBack, "a machine once away is not known back", func(data []byte) error {
|
||||
m, at, err := presenceOf(data)
|
||||
if err == nil {
|
||||
w.heardPresence(m, false, at)
|
||||
logf("%s is back (machine-back): a composition step composes it again", m)
|
||||
}
|
||||
return err
|
||||
}},
|
||||
} {
|
||||
take := s.take
|
||||
cc, err := acct.HearSeatEvents(ctx, js, s.stream, func(m jetstream.Msg) {
|
||||
if err := take(m.Data()); err != nil {
|
||||
logf("%s is not kept: %v", m.Subject(), err)
|
||||
}
|
||||
if err := m.Ack(); err != nil {
|
||||
logf("acknowledging %s: %v", m.Subject(), err)
|
||||
}
|
||||
wake()
|
||||
}, logf, process.FromFirst())
|
||||
if err != nil {
|
||||
nh.NotHeard(s.stream, s.words+" until the assigner starts again", err)
|
||||
continue
|
||||
}
|
||||
nh.Heard(s.stream)
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
cc.Stop()
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// releaseBranch is the branch module's versions are released from: the first watched branch of its registration (§371).
|
||||
func (p *passer) releaseBranch(module string) string {
|
||||
if p.ends.following() {
|
||||
return p.ends.branchOf(module, "")
|
||||
}
|
||||
return p.w.trunkName()
|
||||
}
|
||||
|
||||
// placing is every machine placing module on the branch its versions are released from, sorted.
|
||||
func (p *passer) placing(module string) []string {
|
||||
branch := p.releaseBranch(module)
|
||||
var out []string
|
||||
for node, placed := range p.w.placedBranches()[module] {
|
||||
if p.ends.following() {
|
||||
placed = p.ends.branchOf(module, placed)
|
||||
} else {
|
||||
placed = p.w.trunkName() // the trunk-only form: every placement runs the trunk's
|
||||
}
|
||||
if placed == branch {
|
||||
out = append(out, node)
|
||||
}
|
||||
}
|
||||
sort.Strings(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// deliveryStanding is where module's version stands: the present placing machines not yet running it healthy as its want names
|
||||
// it, and the placing machines away.
|
||||
func (p *passer) deliveryStanding(module, version string) (notRunning, away []string, placing int) {
|
||||
gone := p.w.awayNow()
|
||||
n := assign.Nodes{Running: p.w.runningNow()}
|
||||
wanted := p.w.wantsOf()[module]
|
||||
nodes := p.placing(module)
|
||||
for _, node := range nodes {
|
||||
if gone[node] {
|
||||
away = append(away, node)
|
||||
continue
|
||||
}
|
||||
want, ok := wanted[node]
|
||||
if !ok || want.Removed || want.Version != version || !n.RunsHealthy(node, module, want.Fp) {
|
||||
notRunning = append(notRunning, node)
|
||||
}
|
||||
}
|
||||
return notRunning, away, len(nodes)
|
||||
}
|
||||
|
||||
// judgeDelivered says version-delivered of each module's newest released version not said yet, once every present machine placing
|
||||
// it runs it healthy; judged again at each pass, which each running, machine-away, machine-back and placement change wakes.
|
||||
func (p *passer) judgeDelivered() {
|
||||
for _, module := range p.releasedModules() {
|
||||
rel, _ := p.w.released.newestOf(module)
|
||||
if p.w.delivered.has(module, rel.Version) {
|
||||
continue
|
||||
}
|
||||
notRunning, away, placing := p.deliveryStanding(module, rel.Version)
|
||||
if placing == 0 || len(away) == placing || len(notRunning) > 0 {
|
||||
continue
|
||||
}
|
||||
if err := p.sayDelivered(module, rel, away); err != nil {
|
||||
p.logf("version-delivered of %s %s is not said, and is judged again at the next pass: %v", module, rel.Version, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sayDelivered says version-delivered of module's release rel, with the machines away, and keeps it said.
|
||||
func (p *passer) sayDelivered(module string, rel releaseHeard, away []string) error {
|
||||
at := p.clock().UTC()
|
||||
body := meshwants.VersionDeliveredEvent{V: keys.Version, Module: module, Version: rel.Version, Parts: rel.Parts, Away: away, At: &at}
|
||||
if err := p.wantsSay(meshwants.EventVersionDelivered, body, fmt.Sprintf("%s.%s.%s.%s", meshwants.EventVersionDelivered, module, rel.Version, at.Format(time.RFC3339Nano))); err != nil {
|
||||
return err
|
||||
}
|
||||
p.w.delivered.mark(module, rel.Version)
|
||||
return nil
|
||||
}
|
||||
|
||||
// releasedModules is every module a version-released was heard of, sorted.
|
||||
func (p *passer) releasedModules() []string {
|
||||
r := &p.w.released
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
out := make([]string, 0, len(r.newest))
|
||||
for m := range r.newest {
|
||||
out = append(out, m)
|
||||
}
|
||||
sort.Strings(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// deliveryWait is what a dependent waits for: its dependency, the version and the machines not yet running it.
|
||||
type deliveryWait struct {
|
||||
dependency string
|
||||
rel releaseHeard
|
||||
notRunning []string
|
||||
away []string
|
||||
}
|
||||
|
||||
// waitsForDelivery says whether module, whose want on its nodes changes to fp on branch, waits for a dependency's delivery: by
|
||||
// each edge of kind 2, 4 or 6 into it in branch's catalog half, the dependency's newest released version on branch not yet said
|
||||
// delivered. A want that changes no fingerprint waits for nothing; on a branch no version is released from, nothing waits.
|
||||
func (p *passer) waitsForDelivery(module, fp, branch string, nodes []string) (deliveryWait, bool) {
|
||||
wanted := p.w.wantsOf()[module]
|
||||
changes := false
|
||||
for _, node := range nodes {
|
||||
if w, ok := wanted[node]; !ok || w.Removed || w.Fp != fp {
|
||||
changes = true
|
||||
}
|
||||
}
|
||||
if !changes || fp == "" {
|
||||
return deliveryWait{}, false
|
||||
}
|
||||
var deps []string
|
||||
for _, e := range p.w.edgesOf(branch, module) {
|
||||
if e.Kind != 2 && e.Kind != 4 && e.Kind != 6 {
|
||||
continue
|
||||
}
|
||||
dep, _, _ := strings.Cut(e.From, ":")
|
||||
if dep != "" && dep != module && !slices.Contains(deps, dep) {
|
||||
deps = append(deps, dep)
|
||||
}
|
||||
}
|
||||
sort.Strings(deps)
|
||||
for _, dep := range deps {
|
||||
if p.releaseBranch(dep) != branch {
|
||||
continue
|
||||
}
|
||||
rel, ok := p.w.released.newestOf(dep)
|
||||
if !ok || p.w.delivered.has(dep, rel.Version) {
|
||||
continue
|
||||
}
|
||||
notRunning, away, _ := p.deliveryStanding(dep, rel.Version)
|
||||
return deliveryWait{dependency: dep, rel: rel, notRunning: notRunning, away: away}, true
|
||||
}
|
||||
return deliveryWait{}, false
|
||||
}
|
||||
|
||||
// words is a delivery wait in plain words, as assigner_why_not and the status view say it.
|
||||
func (d deliveryWait) words() string {
|
||||
if len(d.notRunning) == 0 && len(d.away) > 0 {
|
||||
return fmt.Sprintf("waiting for %s to be back", strings.Join(d.away, ", "))
|
||||
}
|
||||
return fmt.Sprintf("waiting for delivery of %s %s on %s", d.dependency, d.rel.Version, strings.Join(d.notRunning, ", "))
|
||||
}
|
||||
|
||||
// deliveryWaitBody is the wait-held of module's delivery wait d.
|
||||
func deliveryWaitBody(module, fp string, d deliveryWait, since time.Time) meshwants.Wait {
|
||||
from := d.rel.At.UTC()
|
||||
if from.IsZero() {
|
||||
from = since.UTC()
|
||||
}
|
||||
return meshwants.Wait{Step: meshwants.WaitStepDelivery, Owner: meshwants.Seat, Module: module, Version: fp, Part: d.dependency,
|
||||
On: d.dependency + "@" + d.rel.Version, Machines: d.notRunning, Since: since.UTC(), ClockFrom: &from, Bound: deliveryWaitBound.String(),
|
||||
Words: d.words()}
|
||||
}
|
||||
|
||||
// deliveryWaiting is one delivery wait the state delivery-waits keeps, by its dependent's name: the wait-held said, and a release
|
||||
// by hand written by assigner_release.
|
||||
type deliveryWaiting struct {
|
||||
meshwants.Wait
|
||||
// Released is set by assigner_release: the wait ends released and the dependent's want is written.
|
||||
Released bool `json:"released,omitempty"`
|
||||
}
|
||||
|
||||
// saidDeliveryWaits is every delivery wait the state delivery-waits holds, by module; a value that does not decode is said and left.
|
||||
func (p *passer) saidDeliveryWaits() map[string]deliveryWaiting {
|
||||
out := map[string]deliveryWaiting{}
|
||||
for key, value := range p.w.read(buckets.DeliveryWaits()) {
|
||||
var w deliveryWaiting
|
||||
if err := json.Unmarshal(value, &w); err != nil || w.Module == "" {
|
||||
p.logf("%s %s holds no delivery wait, left: %v", buckets.DeliveryWaits(), key, err)
|
||||
continue
|
||||
}
|
||||
out[w.Module] = w
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// holdForDelivery says whether module's want, changing to fp on branch, is held for a dependency's delivery this pass: it says
|
||||
// wait-held once and keeps it; a wait released by hand holds nothing; a wait that no longer holds is ended ran.
|
||||
func (p *passer) holdForDelivery(ctx context.Context, module, fp, branch string, nodes []string) bool {
|
||||
if p.kvs[buckets.DeliveryWaits()] == nil {
|
||||
return false
|
||||
}
|
||||
key := keys.EscapeName(module)
|
||||
said, was := p.saidDeliveryWaits()[module]
|
||||
d, waits := p.waitsForDelivery(module, fp, branch, nodes)
|
||||
switch {
|
||||
case was && said.Released:
|
||||
p.endDeliveryWait(ctx, key, said, deliveryWaitReleased) // the want is written now, so it changes nothing at the next pass
|
||||
return false
|
||||
case !waits:
|
||||
if was {
|
||||
p.endDeliveryWait(ctx, key, said, deliveryWaitRan)
|
||||
}
|
||||
return false
|
||||
}
|
||||
body := deliveryWaitBody(module, fp, d, p.clock())
|
||||
if was && said.On == body.On && said.Version == fp && slices.Equal(said.Machines, body.Machines) {
|
||||
return true
|
||||
}
|
||||
if was {
|
||||
body.Since = said.Since
|
||||
}
|
||||
id := fmt.Sprintf("%s.delivery.%s.%s.%s", key, fp, body.On, strings.Join(body.Machines, ","))
|
||||
if err := p.wantsSay(meshwants.EventWaitHeld, body, id); err != nil {
|
||||
p.logf("the delivery wait of %s is not said, and is said at the next pass: %v", module, err)
|
||||
return true
|
||||
}
|
||||
kept := deliveryWaiting{Wait: body}
|
||||
p.put(ctx, buckets.DeliveryWaits(), key, func() ([]byte, error) { return json.Marshal(kept) })
|
||||
p.logf("%s at %s on %s waits for the delivery of its dependency %s on %s: the rules write no want of it until then (design 47 G §376)", module, shortHex(fp), branch, body.On, strings.Join(body.Machines, ", "))
|
||||
return true
|
||||
}
|
||||
|
||||
// endDeliveryWait says wait-ended of a delivery wait with how and removes it from the state.
|
||||
func (p *passer) endDeliveryWait(ctx context.Context, key string, w deliveryWaiting, how string) {
|
||||
body := w.Wait
|
||||
body.How = how
|
||||
if err := p.wantsSay(meshwants.EventWaitEnded, body, key+".delivery."+body.Version+"."+how); err != nil {
|
||||
p.logf("the end of the delivery wait of %s is not said, and is said at the next pass: %v", w.Module, err)
|
||||
return
|
||||
}
|
||||
p.remove(ctx, buckets.DeliveryWaits(), key)
|
||||
}
|
||||
|
||||
// againAsk is one ask of assigner_delivered_again, kept in the state delivered-again under its module (A-250): the version to say
|
||||
// delivered again, who asked and why, and, while it does not hold, why not.
|
||||
type againAsk struct {
|
||||
Module string `json:"module"`
|
||||
Version string `json:"version"`
|
||||
By string `json:"by"`
|
||||
Why string `json:"why"`
|
||||
Waits string `json:"waits,omitempty"`
|
||||
}
|
||||
|
||||
// releaseOf is the release heard of module's version.
|
||||
func (r *releasedVersions) releaseOf(module, version string) (releaseHeard, bool) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
if h, ok := r.newest[module]; ok && h.Version == version {
|
||||
return h, true
|
||||
}
|
||||
for key, k := range r.seen {
|
||||
if strings.HasPrefix(key, module+"@") && k.Version == version {
|
||||
return releaseHeard{Version: version, Parts: k.Parts}, true
|
||||
}
|
||||
}
|
||||
return releaseHeard{}, false
|
||||
}
|
||||
|
||||
// deliveredAgain takes each ask of assigner_delivered_again, heard at once through the watch of the state delivered-again: it says
|
||||
// version-delivered again when every present machine placing the module runs that version healthy and removes the ask, else keeps
|
||||
// it with why it does not hold, which assigner_waits reads.
|
||||
func (p *passer) deliveredAgain(ctx context.Context) {
|
||||
if p.kvs[buckets.DeliveredAgain()] == nil {
|
||||
return
|
||||
}
|
||||
for key, value := range p.w.read(buckets.DeliveredAgain()) {
|
||||
var a againAsk
|
||||
if err := json.Unmarshal(value, &a); err != nil || a.Version == "" {
|
||||
p.logf("%s %s holds no ask, left: %v", buckets.DeliveredAgain(), key, err)
|
||||
continue
|
||||
}
|
||||
module := a.Module
|
||||
if module == "" {
|
||||
module = key
|
||||
}
|
||||
waits := ""
|
||||
rel, ok := p.w.released.releaseOf(module, a.Version)
|
||||
notRunning, away, placing := p.deliveryStanding(module, a.Version)
|
||||
switch {
|
||||
case !ok:
|
||||
waits = fmt.Sprintf("no version-released of %s %s is heard", module, a.Version)
|
||||
case placing == 0:
|
||||
waits = fmt.Sprintf("no machine places %s", module)
|
||||
case len(away) == placing:
|
||||
waits = fmt.Sprintf("every machine placing %s is away: %s", module, strings.Join(away, ", "))
|
||||
case len(notRunning) > 0:
|
||||
waits = fmt.Sprintf("%s %s does not run healthy on %s", module, a.Version, strings.Join(notRunning, ", "))
|
||||
}
|
||||
if waits == "" {
|
||||
if err := p.sayDelivered(module, rel, away); err != nil {
|
||||
p.logf("version-delivered of %s %s asked again is not said, and is asked at the next pass: %v", module, a.Version, err)
|
||||
continue
|
||||
}
|
||||
p.logf("version-delivered of %s %s said again, asked by %s: %s", module, a.Version, a.By, a.Why)
|
||||
p.remove(ctx, buckets.DeliveredAgain(), key)
|
||||
continue
|
||||
}
|
||||
if a.Waits != waits {
|
||||
a.Waits = waits
|
||||
p.put(ctx, buckets.DeliveredAgain(), key, func() ([]byte, error) { return json.Marshal(a) })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,188 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
|
||||
mwc "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshwantsclient"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
|
||||
"mesh-delivery-assigner/internal/buckets"
|
||||
)
|
||||
|
||||
// Design 47 G §376, §389, §498, A-189, A-246: a released version is said version-delivered once, when every present machine placing
|
||||
// it runs healthy the want naming it, a machine away named and not waited for, none when every placing machine is away; a dependent
|
||||
// whose want changes fingerprint waits by an edge of kind 2, 4 or 6 for its dependency's newest released version not yet said
|
||||
// delivered, said wait-held (step delivery, 60 minutes from the release) once and kept in delivery-waits, and wait-ended ran once
|
||||
// the version is delivered; a kind-1 edge, or a dependency with no version released, waits for nothing; one released by hand ends
|
||||
// released and its want is written.
|
||||
func TestADependentWaitsForItsDependencysDelivery(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
at := time.Date(2026, 11, 12, 9, 0, 0, 0, time.UTC)
|
||||
waits := &memKV{values: map[string][]byte{}}
|
||||
again := &memKV{values: map[string][]byte{}}
|
||||
p := newPasser(kvSet{buckets.Wants(): &memKV{values: map[string][]byte{}}, buckets.DeliveryWaits(): waits, buckets.DeliveredAgain(): again}, at)
|
||||
p.logf = t.Logf
|
||||
var events []said
|
||||
p.publishWants = func(event string, body any, id string) error {
|
||||
raw, _ := json.Marshal(body)
|
||||
events = append(events, said{event, id, raw})
|
||||
return nil
|
||||
}
|
||||
p.w.runningHeard = true
|
||||
placeOn(t, p.w, "ace", "db", "app")
|
||||
placeOn(t, p.w, "g14", "db")
|
||||
fp := func(c string) string { return meshcatalogclient.SourcePrefix2 + strings.Repeat(c, 64) }
|
||||
want := func(node, module, fp, version string) {
|
||||
key, _ := mwc.WantKey(node, module)
|
||||
raw, err := mwc.EncodeWant(mwc.Want{Fp: fp, Version: version, Self: true})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
p.w.put(buckets.Wants(), key, raw)
|
||||
}
|
||||
runs := func(node, module, fp string) {
|
||||
raw, _ := json.Marshal(map[string]any{"v": 1, "node": node, "module": module, "fingerprint": fp, "at": at})
|
||||
if err := p.w.hearRunning("running", raw); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
source := int64(3)
|
||||
release := func(module, version string) {
|
||||
source++
|
||||
raw, _ := json.Marshal(meshcatalog.VersionReleasedEvent{V: 1, Module: module, Version: version, Source: source, At: &at,
|
||||
Artifacts: []meshcatalog.VersionArtifact{{Artifact: "program", Digest: "sha256:d"}}})
|
||||
if err := p.w.released.put(raw); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
saidOf := func(event string) []said {
|
||||
var out []said
|
||||
for _, e := range events {
|
||||
if e.event == event {
|
||||
out = append(out, e)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
want("ace", "app", fp("1"), "")
|
||||
|
||||
// No version of db is released: app's new fingerprint waits for nothing.
|
||||
p.w.putEdges(trunkBranch, "app", []meshcatalog.Edge{{Kind: 4, From: "db:program", To: "app:program"}})
|
||||
if p.holdForDelivery(ctx, "app", fp("2"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("app waits with no version of db released")
|
||||
}
|
||||
release("db", "1.1.0")
|
||||
want("ace", "db", fp("d"), "1.1.0")
|
||||
want("g14", "db", fp("d"), "1.1.0")
|
||||
runs("ace", "db", fp("d"))
|
||||
// A kind-1 edge orders nothing.
|
||||
p.w.putEdges(trunkBranch, "app", []meshcatalog.Edge{{Kind: 1, From: "db:program", To: "app:program"}})
|
||||
if p.holdForDelivery(ctx, "app", fp("2"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("a kind-1 edge holds app")
|
||||
}
|
||||
p.w.putEdges(trunkBranch, "app", []meshcatalog.Edge{{Kind: 4, From: "db:program", To: "app:program"}})
|
||||
// app's want unchanged waits for nothing.
|
||||
if p.holdForDelivery(ctx, "app", fp("1"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("app's unchanged want waits")
|
||||
}
|
||||
// g14 places db and does not run 1.1.0 yet: not delivered, and app's new version waits, said once.
|
||||
p.judgeDelivered()
|
||||
if !p.holdForDelivery(ctx, "app", fp("2"), trunkBranch, []string{"ace"}) || !p.holdForDelivery(ctx, "app", fp("2"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("app does not wait for db 1.1.0")
|
||||
}
|
||||
if len(saidOf(meshwants.EventVersionDelivered)) != 0 {
|
||||
t.Fatalf("db is said delivered while g14 does not run it: %+v", events)
|
||||
}
|
||||
held := saidOf(meshwants.EventWaitHeld)
|
||||
if len(held) != 1 {
|
||||
t.Fatalf("wait-held said %d times, want once", len(held))
|
||||
}
|
||||
var w meshwants.Wait
|
||||
_ = json.Unmarshal(held[0].body, &w)
|
||||
if w.Step != meshwants.WaitStepDelivery || w.Part != "db" || w.Module != "app" || w.Version != fp("2") || w.Bound != "1h0m0s" ||
|
||||
w.ClockFrom == nil || !w.ClockFrom.Equal(at) || len(w.Machines) != 1 || w.Machines[0] != "g14" || w.Words != "waiting for delivery of db 1.1.0 on g14" {
|
||||
t.Errorf("the wait said is %+v", w)
|
||||
}
|
||||
if _, ok := waits.values["app"]; !ok {
|
||||
t.Errorf("the wait is not kept in delivery-waits: %v", waits.values)
|
||||
}
|
||||
// g14 away: every present machine runs it, so it is delivered, g14 named away; once only.
|
||||
p.w.heardPresence("g14", true, at)
|
||||
p.judgeDelivered()
|
||||
p.judgeDelivered()
|
||||
delivered := saidOf(meshwants.EventVersionDelivered)
|
||||
var d meshwants.VersionDeliveredEvent
|
||||
if len(delivered) != 1 || json.Unmarshal(delivered[0].body, &d) != nil || d.Module != "db" || d.Version != "1.1.0" ||
|
||||
len(d.Away) != 1 || d.Away[0] != "g14" || d.Parts["db:program"] != "sha256:d" {
|
||||
t.Fatalf("version-delivered said %+v", delivered)
|
||||
}
|
||||
// The wait ends ran, and app's want goes on.
|
||||
if p.holdForDelivery(ctx, "app", fp("2"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("app still waits once db 1.1.0 is delivered")
|
||||
}
|
||||
ended := saidOf(meshwants.EventWaitEnded)
|
||||
if len(ended) != 1 || json.Unmarshal(ended[0].body, &w) != nil || w.How != deliveryWaitRan {
|
||||
t.Errorf("wait-ended said %+v", ended)
|
||||
}
|
||||
if _, ok := waits.values["app"]; ok {
|
||||
t.Error("the ended wait is kept")
|
||||
}
|
||||
// A newer release with every placing machine away is not delivered, and its wait says the machines it waits to be back.
|
||||
release("db", "1.2.0")
|
||||
p.w.heardPresence("ace", true, at)
|
||||
p.judgeDelivered()
|
||||
if len(saidOf(meshwants.EventVersionDelivered)) != 1 {
|
||||
t.Error("a version is said delivered while every placing machine is away")
|
||||
}
|
||||
if !p.holdForDelivery(ctx, "app", fp("3"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("app does not wait for db 1.2.0")
|
||||
}
|
||||
held = saidOf(meshwants.EventWaitHeld)
|
||||
if json.Unmarshal(held[len(held)-1].body, &w) != nil || w.Words != "waiting for ace, g14 to be back" {
|
||||
t.Errorf("the wait while every machine is away says %q", w.Words)
|
||||
}
|
||||
// Released by hand (assigner_release writes it): the wait ends released and app's want is written.
|
||||
var kept deliveryWaiting
|
||||
_ = json.Unmarshal(waits.values["app"], &kept)
|
||||
kept.Released = true
|
||||
raw, _ := json.Marshal(kept)
|
||||
p.w.put(buckets.DeliveryWaits(), "app", raw)
|
||||
if p.holdForDelivery(ctx, "app", fp("3"), trunkBranch, []string{"ace"}) {
|
||||
t.Fatal("a released wait holds app")
|
||||
}
|
||||
ended = saidOf(meshwants.EventWaitEnded)
|
||||
if json.Unmarshal(ended[len(ended)-1].body, &w) != nil || w.How != deliveryWaitReleased {
|
||||
t.Errorf("the released wait ended %+v", w)
|
||||
}
|
||||
// Presence: the later of machine-away and machine-back holds, whichever stream is read first.
|
||||
p.w.heardPresence("ace", false, at.Add(time.Minute))
|
||||
p.w.heardPresence("ace", true, at)
|
||||
if p.w.awayNow()["ace"] || !p.w.online()["ace"] {
|
||||
t.Error("an older machine-away read after a newer machine-back leaves ace away")
|
||||
}
|
||||
// A-250: an ask of assigner_delivered_again of 1.1.0, which ace (present) runs and g14 (away) does not, is said again and taken
|
||||
// away; one of 1.2.0, which no machine runs, is kept with why.
|
||||
ask := func(version string) {
|
||||
raw, _ := json.Marshal(againAsk{Module: "db", Version: version, By: "op", Why: "the catalog missed it"})
|
||||
p.w.put(buckets.DeliveredAgain(), "db", raw)
|
||||
}
|
||||
before := len(saidOf(meshwants.EventVersionDelivered))
|
||||
ask("1.1.0")
|
||||
p.deliveredAgain(ctx)
|
||||
if len(saidOf(meshwants.EventVersionDelivered)) != before+1 || p.w.has(buckets.DeliveredAgain(), "db") {
|
||||
t.Errorf("the ask of 1.1.0 said %d version-delivered and is kept %v", len(saidOf(meshwants.EventVersionDelivered))-before, p.w.has(buckets.DeliveredAgain(), "db"))
|
||||
}
|
||||
ask("1.2.0")
|
||||
p.deliveredAgain(ctx)
|
||||
var a againAsk
|
||||
if json.Unmarshal(p.w.value(buckets.DeliveredAgain(), "db"), &a) != nil || a.Waits != "db 1.2.0 does not run healthy on ace" ||
|
||||
len(saidOf(meshwants.EventVersionDelivered)) != before+1 {
|
||||
t.Errorf("the ask of 1.2.0 = %+v", a)
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"fmt"
|
||||
mcseat "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions"
|
||||
wd "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshwatchdogs"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
"git.novox.be/novox/mesh-sdk/go/keys"
|
||||
"io"
|
||||
"maps"
|
||||
@@ -202,10 +201,9 @@ func startBed(t *testing.T, leaveOut string) *bed {
|
||||
if _, err := js.CreateOrUpdateConsumer(ctx, nodeengine.StreamRunning, jetstream.ConsumerConfig{Durable: "n1_mesh-delivery-assigner", AckPolicy: jetstream.AckExplicitPolicy}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// The watchman's machine-away and machine-back and the assigner's own version-delivered, kept by age, which it reads whole from their
|
||||
// first message at its start and then follows through its durable (design 47 G §376, §389, A-189, A-233).
|
||||
for _, k := range []struct{ stream, subject string }{{wd.StreamMachineAway, wd.SubjectMachineAwayAll}, {wd.StreamMachineBack, wd.SubjectMachineBackAll},
|
||||
{meshwants.StreamVersionDelivered, meshwants.SubjectVersionDelivered}} {
|
||||
// The watchman's machine-away and machine-back, kept by age, which it reads whole from their first message at its start and
|
||||
// then follows through its durable (design 47 G §389, A-233).
|
||||
for _, k := range []struct{ stream, subject string }{{wd.StreamMachineAway, wd.SubjectMachineAwayAll}, {wd.StreamMachineBack, wd.SubjectMachineBackAll}} {
|
||||
if _, err := js.CreateStream(ctx, keptStream(k.stream, k.subject, jetstream.StreamConfig{MaxAge: 90 * 24 * time.Hour})); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func ownBuckets() []string {
|
||||
return []string{buckets.Asks(), buckets.Differences(),
|
||||
buckets.Puts(), buckets.Wants(), plc.AssignmentsBucket(), plc.ProposalsBucket(),
|
||||
plc.CandidatesBucket(), plc.PulsesBucket(), assign.FindingsBucket(), assign.PoliciesBucket(), plc.SeatHoldersBucket(),
|
||||
engineReadsBucket(), retiredBucket(), copiesBucket(), writtenBucket(), buckets.Waits(), buckets.PutWaits(), buckets.DeliveryWaits(), buckets.DeliveredAgain(), buckets.Inputs(), buckets.CompositionRuns(), pinsBucket()}
|
||||
engineReadsBucket(), retiredBucket(), copiesBucket(), writtenBucket(), buckets.Waits(), buckets.PutWaits(), buckets.Inputs(), buckets.CompositionRuns(), pinsBucket()}
|
||||
}
|
||||
|
||||
// engineReadsState is the assigner's state of what each node's engine states it reads (ADR 0618 §3), one key `<node>`, as
|
||||
@@ -135,8 +135,6 @@ var keptStates = []announce.State{
|
||||
{Name: writtenState, Readable: true},
|
||||
{Name: buckets.WaitsState, Readable: true},
|
||||
{Name: buckets.PutWaitsState, Readable: true}, // the put waits said (putwaits.go, design 47 G A-211)
|
||||
{Name: buckets.DeliveryWaitsState, Readable: true}, // the delivery waits said (delivered.go, design 47 G A-246)
|
||||
{Name: buckets.DeliveredAgainState, Readable: true}, // the asks of assigner_delivered_again (delivered.go, design 47 G A-250)
|
||||
{Name: buckets.InputsState, Readable: true}, // read by the tool process alone: the verb input and assigner_inputs (design 47 G §354)
|
||||
{Name: buckets.CompositionRunsState, Readable: true}, // the composition runs, read by the process and its tools (design 47 G §719, A-468c)
|
||||
{Name: pinsState, Readable: true}, // the records pinning each assignment graph revision (design 47 G §579)
|
||||
@@ -208,16 +206,6 @@ func open(ctx context.Context, js process.BucketOpener, logf func(string, ...any
|
||||
logf("the bucket %s cannot be opened (%v): no outside wait is kept until the assigner starts again", name, err)
|
||||
continue
|
||||
}
|
||||
if name == buckets.DeliveredAgain() && err != nil {
|
||||
// New with A-250: without it assigner_delivered_again is not taken until the assigner starts again.
|
||||
logf("the bucket %s cannot be opened (%v): no version is said delivered again until the assigner starts again", name, err)
|
||||
continue
|
||||
}
|
||||
if name == buckets.DeliveryWaits() && err != nil {
|
||||
// New with A-246: without it no dependent waits for its dependency's delivery until the assigner starts again.
|
||||
logf("the bucket %s cannot be opened (%v): no delivery wait is kept until the assigner starts again", name, err)
|
||||
continue
|
||||
}
|
||||
if name == buckets.PutWaits() && err != nil {
|
||||
// New with A-211: without it no put's wait is said until the assigner starts again.
|
||||
logf("the bucket %s cannot be opened (%v): no put's wait is said until the assigner starts again", name, err)
|
||||
@@ -247,7 +235,7 @@ func open(ctx context.Context, js process.BucketOpener, logf func(string, ...any
|
||||
func startsWithout(name string) bool {
|
||||
switch name {
|
||||
case plc.SeatHoldersBucket(), buckets.Provisions, assign.PoliciesBucket(), assign.FindingsBucket(),
|
||||
buckets.Puts(), engineReadsBucket(), retiredBucket(), writtenBucket(), buckets.Waits(), buckets.PutWaits(), buckets.DeliveryWaits(), buckets.DeliveredAgain(), buckets.Inputs(), pinsBucket():
|
||||
buckets.Puts(), engineReadsBucket(), retiredBucket(), writtenBucket(), buckets.Waits(), buckets.PutWaits(), buckets.Inputs(), pinsBucket():
|
||||
return true
|
||||
}
|
||||
return slices.Contains(seatBuckets(), name) || name == buckets.Grants
|
||||
@@ -394,8 +382,6 @@ func watched() []string {
|
||||
writtenBucket(),
|
||||
buckets.Waits(),
|
||||
buckets.PutWaits(),
|
||||
buckets.DeliveryWaits(),
|
||||
buckets.DeliveredAgain(), // its watch wakes a pass at once on an ask of assigner_delivered_again (A-250)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,7 +676,7 @@ func follow(ctx context.Context, js jetstream.JetStream, nc process.Subscriber,
|
||||
logger.Printf("a pipeline's end or a registration is not heard, so the wants keep the trunk-only form until the assigner starts again: %v", err)
|
||||
}
|
||||
}
|
||||
hearDelivery(ctx, js, w, wake, findings, logger.Printf) // version-released, version-delivered, machine-away and machine-back
|
||||
hearReleases(ctx, js, w, wake, findings, logger.Printf) // version-released, machine-away and machine-back
|
||||
hearBuilds(ctx, js, &w.ends, wake, findings, logger.Printf)
|
||||
if err := hearTaken(hub, &w.taken, wake, logger.Printf); err != nil {
|
||||
logger.Printf("the indexer's take-ins are not heard, so an entry held by an order edge waits until the assigner starts again: %v", err)
|
||||
|
||||
@@ -241,7 +241,7 @@ func TestAnOrderWaitIsReadAndReleasedByTheExistingTools(t *testing.T) {
|
||||
f.pass()
|
||||
f.pass()
|
||||
var acts []string
|
||||
s := newPutTools(memStore{waitsState: f.p.kvs[buckets.Waits()].(*memKV), buckets.DeliveryWaitsState: &memKV{values: map[string][]byte{}}, buckets.DeliveredAgainState: &memKV{values: map[string][]byte{}}}, func(key string, body any) (json.RawMessage, error) {
|
||||
s := newPutTools(memStore{waitsState: f.p.kvs[buckets.Waits()].(*memKV)}, func(key string, body any) (json.RawMessage, error) {
|
||||
acts = append(acts, key)
|
||||
return json.RawMessage(`{"ok":true,"log":"logged"}`), nil
|
||||
})
|
||||
|
||||
@@ -259,7 +259,7 @@ func TestTheToolsReadAndReleaseAnOutsideWait(t *testing.T) {
|
||||
r.cond("machine.hub.unreachable", "ace")
|
||||
r.review(false, nil)
|
||||
var acts []string
|
||||
s := newPutTools(memStore{waitsState: &memKV{values: map[string][]byte{}}, buckets.DeliveryWaitsState: &memKV{values: map[string][]byte{}}, buckets.DeliveredAgainState: &memKV{values: map[string][]byte{}}}, func(key string, body any) (json.RawMessage, error) {
|
||||
s := newPutTools(memStore{waitsState: &memKV{values: map[string][]byte{}}}, func(key string, body any) (json.RawMessage, error) {
|
||||
acts = append(acts, key)
|
||||
return json.RawMessage(`{"ok":true,"log":"logged"}`), nil
|
||||
})
|
||||
@@ -296,38 +296,4 @@ func TestTheToolsReadAndReleaseAnOutsideWait(t *testing.T) {
|
||||
if r.bodies[len(r.bodies)-1].How != "go-on" || n.Haves["ace"]["nats"].Health != nodeengineclient.HealthOK {
|
||||
t.Errorf("last %+v health %s", r.bodies[len(r.bodies)-1], n.Haves["ace"]["nats"].Health)
|
||||
}
|
||||
// A-246: a dependent's delivery wait is listed beside them, and released by its module and step delivery, its hand act first.
|
||||
dw, _ := json.Marshal(deliveryWaiting{Wait: meshwants.Wait{Step: meshwants.WaitStepDelivery, Module: "app", Part: "db", On: "db@1.1.0", Machines: []string{"g14"}}})
|
||||
s.st.put(buckets.DeliveryWaitsState, "app", dw)
|
||||
got, err = s.doWaits(map[string]any{"node": "g14"})
|
||||
if d := got.(map[string]any)["delivery"].([]deliveryWaiting); err != nil || len(d) != 1 || d[0].Module != "app" {
|
||||
t.Errorf("the delivery waits listed = %+v %v", got, err)
|
||||
}
|
||||
if _, err := s.doRelease(map[string]any{"module": "app", "step": "build", "why": "x"}, "shanks.node-tools"); err == nil {
|
||||
t.Error("a release of another step is taken")
|
||||
}
|
||||
if _, err := s.doRelease(map[string]any{"module": "web", "step": "delivery", "why": "x"}, "shanks.node-tools"); err == nil {
|
||||
t.Error("a release of a module waiting for no delivery is taken")
|
||||
}
|
||||
before := len(acts)
|
||||
if _, err := s.doRelease(map[string]any{"module": "app", "step": "delivery", "why": "db is fine as it runs"}, "shanks.node-tools"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
raw, _, _, _ = s.st.get(buckets.DeliveryWaitsState, "app")
|
||||
var released deliveryWaiting
|
||||
if json.Unmarshal(raw, &released) != nil || !released.Released || !strings.Contains(released.By, "db is fine") || len(acts) != before+1 {
|
||||
t.Errorf("the delivery wait after its release = %+v, hand acts %v", released, acts[before:])
|
||||
}
|
||||
// A-250: assigner_delivered_again records its hand act, writes the ask and answers asked; assigner_waits lists it.
|
||||
if _, err := s.doDeliveredAgain(map[string]any{"module": "db", "version": "1.1.0"}, "op"); err == nil {
|
||||
t.Error("an ask with no why is taken")
|
||||
}
|
||||
ans, err := s.doDeliveredAgain(map[string]any{"module": "db", "version": "1.1.0", "why": "the catalog missed it"}, "op")
|
||||
if err != nil || ans.(map[string]any)["asked"] != "db" || len(acts) != before+2 {
|
||||
t.Fatalf("assigner_delivered_again = %+v %v", ans, err)
|
||||
}
|
||||
got, _ = s.doWaits(map[string]any{})
|
||||
if a := got.(map[string]any)["delivered-again"].([]againAsk); len(a) != 1 || a[0].Version != "1.1.0" || a[0].By != "op" {
|
||||
t.Errorf("the asks listed = %+v", a)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
@@ -10,9 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
"git.novox.be/novox/mesh-sdk/go/keys"
|
||||
|
||||
"mesh-delivery-assigner/internal/acting"
|
||||
"mesh-delivery-assigner/internal/buckets"
|
||||
@@ -79,111 +76,7 @@ func (s *putTools) doWaits(args map[string]any) (any, error) {
|
||||
}
|
||||
out = append(out, said)
|
||||
}
|
||||
// And each dependent's wait for its dependency's delivery (design 47 G §376, A-246), from the state delivery-waits.
|
||||
delivery := []deliveryWaiting{}
|
||||
dkeys, err := s.st.keys(buckets.DeliveryWaitsState)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the delivery waits cannot be listed: %w", err)
|
||||
}
|
||||
sort.Strings(dkeys)
|
||||
for _, key := range dkeys {
|
||||
raw, _, found, err := s.st.get(buckets.DeliveryWaitsState, key)
|
||||
if err != nil || !found {
|
||||
continue
|
||||
}
|
||||
var w deliveryWaiting
|
||||
if json.Unmarshal(raw, &w) != nil || (arg(args, "module") != "" && w.Module != arg(args, "module")) ||
|
||||
(arg(args, "node") != "" && !slices.Contains(w.Machines, arg(args, "node"))) {
|
||||
continue
|
||||
}
|
||||
delivery = append(delivery, w)
|
||||
}
|
||||
// And each ask of assigner_delivered_again not yet holding, with why (A-250).
|
||||
again := []againAsk{}
|
||||
akeys, err := s.st.keys(buckets.DeliveredAgainState)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the asks to say a version delivered again cannot be listed: %w", err)
|
||||
}
|
||||
sort.Strings(akeys)
|
||||
for _, key := range akeys {
|
||||
raw, _, found, err := s.st.get(buckets.DeliveredAgainState, key)
|
||||
var a againAsk
|
||||
if err != nil || !found || json.Unmarshal(raw, &a) != nil || (arg(args, "module") != "" && a.Module != arg(args, "module")) {
|
||||
continue
|
||||
}
|
||||
again = append(again, a)
|
||||
}
|
||||
return map[string]any{"waits": out, "delivery": delivery, "delivered-again": again}, nil
|
||||
}
|
||||
|
||||
// toolDeliveredAgain is the tool that asks version-delivered said again for one version (design 47 G §376, A-250).
|
||||
const toolDeliveredAgain = "assigner_delivered_again"
|
||||
|
||||
// doDeliveredAgain is assigner_delivered_again: the hand act is recorded first, then the ask is written into the state
|
||||
// delivered-again, whose watch the assigner's process hears at once; it answers that it is asked.
|
||||
func (s *putTools) doDeliveredAgain(args map[string]any, by string) (any, error) {
|
||||
module, version, why := arg(args, "module"), arg(args, "version"), arg(args, "why")
|
||||
if module == "" || version == "" || why == "" {
|
||||
return nil, errors.New("assigner_delivered_again names the module, its version and why: it is kept in the hand-act log")
|
||||
}
|
||||
rec := meshhandactsclient.Recorder{Ask: s.ask}
|
||||
taken, err := rec.Record(meshhandactsclient.Request{What: fmt.Sprintf("assigner_delivered_again %s %s", module, version), Why: why,
|
||||
Cause: "version-delivered", Verb: "mesh-wants.assigner_delivered_again"})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the hand act could not be recorded, so nothing was asked: %w", err)
|
||||
}
|
||||
data, err := json.Marshal(againAsk{Module: module, Version: version, By: by, Why: why})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.st.put(buckets.DeliveredAgainState, keys.EscapeName(module), data); err != nil {
|
||||
return nil, fmt.Errorf("the ask of %s %s is not written: %w", module, version, err)
|
||||
}
|
||||
return map[string]any{"asked": module, "version": version, "hand-act": taken.Log,
|
||||
"follow": "the assigner says version-delivered again once every present machine placing it runs it healthy; assigner_waits says why it does not yet"}, nil
|
||||
}
|
||||
|
||||
// deliveredAgainTool is assigner_delivered_again as the runtime serves it.
|
||||
func (s *putTools) deliveredAgainTool() stdio.Tool {
|
||||
return stdio.Tool{Name: toolDeliveredAgain, Description: "Say version-delivered again for one version of a module, for the operator and the healers " +
|
||||
"(design 47 G §376): written in the hand-act log first, then asked of the assigner, which says it once every present machine placing " +
|
||||
"the module runs that version healthy; until then assigner_waits lists the ask with why it does not hold. Answers that it is asked.",
|
||||
Input: schema(map[string]string{"module": "the module", "version": "its MAJOR.MINOR.PATCH", "why": "why, kept in the hand-act log"},
|
||||
[]string{"module", "version", "why"}),
|
||||
Run: func(a map[string]any) (any, error) { return s.doDeliveredAgain(a, stdio.CallerOf(a)) }}
|
||||
}
|
||||
|
||||
// doReleaseDelivery is assigner_release with step delivery: the hand act is recorded first, then the release is written on the
|
||||
// module's delivery wait, which the assigner's process ends released at its next pass, writing the module's want.
|
||||
func (s *putTools) doReleaseDelivery(args map[string]any, by string) (any, error) {
|
||||
module, why := arg(args, "module"), arg(args, "why")
|
||||
if why == "" {
|
||||
return nil, errors.New("release says why: it is kept in the hand-act log")
|
||||
}
|
||||
key := keys.EscapeName(module)
|
||||
raw, _, found, err := s.st.get(buckets.DeliveryWaitsState, key)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the delivery wait of %s is not read: %w", module, err)
|
||||
}
|
||||
var w deliveryWaiting
|
||||
if !found || json.Unmarshal(raw, &w) != nil || w.Released {
|
||||
return nil, fmt.Errorf("%s waits for no delivery: assigner_waits lists the delivery waits", module)
|
||||
}
|
||||
rec := meshhandactsclient.Recorder{Ask: s.ask}
|
||||
taken, err := rec.Record(meshhandactsclient.Request{What: fmt.Sprintf("assigner_release %s step delivery (waits on %s)", module, w.On), Why: why,
|
||||
Cause: "delivery-wait", Verb: "mesh-wants.assigner_release"})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the hand act could not be recorded, so nothing was released: %w", err)
|
||||
}
|
||||
w.Released, w.By = true, by+": "+why
|
||||
data, err := json.Marshal(w)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := s.st.put(buckets.DeliveryWaitsState, key, data); err != nil {
|
||||
return nil, fmt.Errorf("the release of %s's delivery wait is not written: %w", module, err)
|
||||
}
|
||||
return map[string]any{"released": module, "step": meshwants.WaitStepDelivery, "by": by, "hand-act": taken.Log}, nil
|
||||
return map[string]any{"waits": out}, nil
|
||||
}
|
||||
|
||||
// doReleaseWait is assigner_release with how: the hand act is recorded first, then the release is written on the wait of node and
|
||||
|
||||
@@ -230,8 +230,6 @@ func (p *passer) clock() time.Time {
|
||||
func (p *passer) pass(ctx context.Context) {
|
||||
p.assignmentsSeat(ctx)
|
||||
p.keepGraph(ctx)
|
||||
p.judgeDelivered()
|
||||
p.deliveredAgain(ctx)
|
||||
if p.graph == nil || !p.graph.full { // a full assignment graph store keeps the last revision and writes no new want (design 47 G §181)
|
||||
p.wants(ctx)
|
||||
p.sayPass(ctx, "judged")
|
||||
@@ -360,11 +358,6 @@ func (p *passer) wants(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// A dependent's new version waits for its dependency's newest released version to be delivered (§376, A-189).
|
||||
if p.holdForDelivery(ctx, name, fp, g.branch, g.nodes) {
|
||||
p.sayWhy(ctx, name, g.nodes, wantWhy{Branch: g.branch, Fp: fp, Step: whyDelivery, Words: p.saidDeliveryWaits()[name].Wait.On}, wantedOf[name], nil, nil)
|
||||
return
|
||||
}
|
||||
m := assign.Module{Name: name, FP: fp, Manifest: manifests[name], Needs: trunk[name].Needs, Chosen: chosenOf(chosen, name), Provisions: provisionsOf(name), Answering: answering(manifests, nodes), Offered: offered(manifests), Nodes: nodesOf[name], Now: time.Now(), Puts: puts[name], FormNeeds: p.w.buildNeeds(name, fp),
|
||||
Self: func(node string) bool { return placed[node] },
|
||||
Composed: func(node, fp string) (assign.ComposedDigest, bool) {
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go/jetstream"
|
||||
|
||||
wd "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshwatchdogs"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
|
||||
"mesh-delivery-assigner/internal/assign"
|
||||
"mesh-delivery-assigner/internal/assignment"
|
||||
)
|
||||
|
||||
// releaseHeard is one version-released heard: the version, each part's digest, the source revision and when it was said.
|
||||
type releaseHeard struct {
|
||||
Version string
|
||||
Parts map[string]string
|
||||
Source int64
|
||||
At time.Time
|
||||
}
|
||||
|
||||
// presenceOf reads one machine-away or machine-back: the machine and when it was said.
|
||||
func presenceOf(data []byte) (string, time.Time, error) {
|
||||
var e wd.MachineAwayEvent // machine-back has the same fields
|
||||
if err := json.Unmarshal(data, &e); err != nil {
|
||||
return "", time.Time{}, err
|
||||
}
|
||||
if e.Machine == "" {
|
||||
return "", time.Time{}, fmt.Errorf("it names no machine: %s", data)
|
||||
}
|
||||
return e.Machine, e.At, nil
|
||||
}
|
||||
|
||||
// hearReleases reads whole, from their first message, then follows, the catalog seat's version-released and the watchman's
|
||||
// machine-away and machine-back (mesh-sdk process.FromFirst, A-233), never their state. A stream not heard is said as the assigner's finding, and what it carries is not known until
|
||||
// the assigner starts again.
|
||||
func hearReleases(ctx context.Context, js jetstream.JetStream, w *world, wake func(), findings assign.Findings, logf func(string, ...any)) {
|
||||
acct := process.Account{Node: thisNode, Module: assignment.Module()}
|
||||
nh := notHeardWriter(findings, logf)
|
||||
for _, s := range []struct {
|
||||
stream, words string
|
||||
take func([]byte) error
|
||||
}{
|
||||
{meshcatalog.StreamVersionReleased, "no want names a released version", w.released.put},
|
||||
{wd.StreamMachineAway, "no machine is known away, so a delivery waits for a machine that is away", func(data []byte) error {
|
||||
m, at, err := presenceOf(data)
|
||||
if err == nil {
|
||||
w.heardPresence(m, true, at)
|
||||
logf("%s is away (machine-away): a composition step does not compose it until its machine-back", m)
|
||||
}
|
||||
return err
|
||||
}},
|
||||
{wd.StreamMachineBack, "a machine once away is not known back", func(data []byte) error {
|
||||
m, at, err := presenceOf(data)
|
||||
if err == nil {
|
||||
w.heardPresence(m, false, at)
|
||||
logf("%s is back (machine-back): a composition step composes it again", m)
|
||||
}
|
||||
return err
|
||||
}},
|
||||
} {
|
||||
take := s.take
|
||||
cc, err := acct.HearSeatEvents(ctx, js, s.stream, func(m jetstream.Msg) {
|
||||
if err := take(m.Data()); err != nil {
|
||||
logf("%s is not kept: %v", m.Subject(), err)
|
||||
}
|
||||
if err := m.Ack(); err != nil {
|
||||
logf("acknowledging %s: %v", m.Subject(), err)
|
||||
}
|
||||
wake()
|
||||
}, logf, process.FromFirst())
|
||||
if err != nil {
|
||||
nh.NotHeard(s.stream, s.words+" until the assigner starts again", err)
|
||||
continue
|
||||
}
|
||||
nh.Heard(s.stream)
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
cc.Stop()
|
||||
}()
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,6 @@ import (
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/catalogkey"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
"git.novox.be/novox/mesh-sdk/go/seatlist"
|
||||
"git.novox.be/novox/mesh-sdk/go/stateobjects"
|
||||
@@ -215,12 +214,6 @@ func (s *putTools) doRelease(args map[string]any, by string) (any, error) {
|
||||
if arg(args, "how") != "" {
|
||||
return s.doReleaseWait(args, by) // a wait on an outside cause (outside_tools.go, design 47 G §706)
|
||||
}
|
||||
if step := arg(args, "step"); step != "" {
|
||||
if step != meshwants.WaitStepDelivery {
|
||||
return nil, fmt.Errorf("step is %s, the one wait released by its step, not %q", meshwants.WaitStepDelivery, step)
|
||||
}
|
||||
return s.doReleaseDelivery(args, by) // a dependent's delivery wait (delivered.go, design 47 G §376, A-246)
|
||||
}
|
||||
node, module, why := arg(args, "node"), arg(args, "module"), arg(args, "why")
|
||||
key, err := puts.Key(node, module)
|
||||
if err != nil {
|
||||
@@ -353,12 +346,10 @@ func (s *putTools) tools() []stdio.Tool {
|
||||
"rules write the machine's want again from their next pass. Nothing changes on the machine until they move it.",
|
||||
Input: schema(map[string]string{"node": "the machine", "module": "the module", "why": "why, kept with the put",
|
||||
"how": "with how, the wait of the delivery on an outside cause (assigner_waits) is released, not a put: go-on (the module counts healthy there), " +
|
||||
"failed (the failing check is the delivery's), rejudge (judge it again now), or now (the entry waiting for an acting part's new version moves with the running one); written in the hand-act log first",
|
||||
"step": "delivery: the module's wait for its dependency's delivery (assigner_waits) is released, its want written now; no machine is named; written in the hand-act log first"},
|
||||
"failed (the failing check is the delivery's), rejudge (judge it again now), or now (the entry waiting for an acting part's new version moves with the running one); written in the hand-act log first"},
|
||||
[]string{"module", "why"}),
|
||||
Run: func(a map[string]any) (any, error) { return s.doRelease(a, stdio.CallerOf(a)) }},
|
||||
s.waitsTool(),
|
||||
s.deliveredAgainTool(),
|
||||
{Name: toolPuts, Description: "Every put and where it stands (novox/hq ADR 0546): its version, hold, why, each step with " +
|
||||
"its time and words. Narrowed by machine or module. Read-only.",
|
||||
Input: schema(map[string]string{"node": "one machine", "module": "one module"}, nil),
|
||||
|
||||
@@ -27,7 +27,6 @@ const whyTool = "assigner_why"
|
||||
// The steps of the pass that decide a want.
|
||||
const (
|
||||
whyNoPipeline = "no-passed-pipeline" // the trunk's fingerprint passed no pipeline on the branch, and no want names it
|
||||
whyDelivery = "waits-for-delivery" // a dependency's newest released version is not delivered yet
|
||||
whyRules = "rules" // the six rules judged it
|
||||
)
|
||||
|
||||
@@ -104,7 +103,7 @@ func (p *passer) sayWhy(ctx context.Context, module string, nodes []string, w wa
|
||||
|
||||
// whyTools is the tool assigner_why: every want's why, or those of one module or one node.
|
||||
func whyTools(st store) []stdio.Tool {
|
||||
return []stdio.Tool{{Name: whyTool, Description: "why a want is what it is: per node and module, the step of the assigner's last pass that decided the want (no passed pipeline, waits for a dependency's delivery, or the six rules with the rule holding it back), the fingerprint the trunk names, the want before and the one written, and what the rules read (built, held, granted, acting waits). A time that stands still says the pass no longer judges that module. Arguments: module and node narrow it.",
|
||||
return []stdio.Tool{{Name: whyTool, Description: "why a want is what it is: per node and module, the step of the assigner's last pass that decided the want (no passed pipeline, or the six rules with the rule holding it back), the fingerprint the trunk names, the want before and the one written, and what the rules read (built, held, granted, acting waits). A time that stands still says the pass no longer judges that module. Arguments: module and node narrow it.",
|
||||
Input: schema(map[string]string{"module": "a module's name", "node": "a node's name"}, nil),
|
||||
Run: func(args map[string]any) (any, error) {
|
||||
ks, err := st.keys(writtenState)
|
||||
|
||||
@@ -43,8 +43,6 @@ type world struct {
|
||||
ends builtEnds
|
||||
// released are the catalog's version-released heard, by module and source revision (buildended.go).
|
||||
released releasedVersions
|
||||
// delivered are the assigner's own version-delivered heard and said (delivered.go).
|
||||
delivered deliveredVersions
|
||||
// edges are, by watched branch and module, the edges into the module's artifacts its catalog entry names (§374's kinds).
|
||||
edges map[string]map[string][]meshcatalog.Edge
|
||||
// taken is the newest source revision of each watched branch the indexer's take-in.taken named, as heard (orderwaits.go, §298, A-260).
|
||||
|
||||
@@ -18,12 +18,6 @@ import (
|
||||
const (
|
||||
// WaitsState holds the waits on an outside cause, one key `<node>.<module>.<fingerprint hex>` (design 47 G §706).
|
||||
WaitsState = "waits"
|
||||
// DeliveredAgainState holds each ask of assigner_delivered_again, one key `<module>`, its value the version, who asked and why, and
|
||||
// why it does not hold yet (design 47 G §376, A-250).
|
||||
DeliveredAgainState = "delivered-again"
|
||||
// DeliveryWaitsState holds each dependent's delivery wait the assigner said, one key `<module>`, its value the wait-held said
|
||||
// (design 47 G §376, §498, A-246).
|
||||
DeliveryWaitsState = "delivery-waits"
|
||||
// PutWaitsState holds each put wait the assigner said, one key `<node>.<module>`, its value the wait's id and the put as said
|
||||
// (design 47 G A-204, A-211), so a put that ends while the assigner is stopped gets its wait-ended at the next start.
|
||||
PutWaitsState = "put-waits"
|
||||
@@ -45,8 +39,6 @@ func Differences() string { return own(wants.StateDifferences) }
|
||||
func Asks() string { return own("asks") }
|
||||
func Puts() string { return own("puts") }
|
||||
func Waits() string { return own(WaitsState) }
|
||||
func DeliveredAgain() string { return own(DeliveredAgainState) }
|
||||
func DeliveryWaits() string { return own(DeliveryWaitsState) }
|
||||
func PutWaits() string { return own(PutWaitsState) }
|
||||
func Inputs() string { return own(InputsState) }
|
||||
func CompositionRuns() string { return own(CompositionRunsState) }
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestManifest(t *testing.T) {
|
||||
}
|
||||
if want := map[string]int{"asks": 5, "differences": 64, "puts": 20, "wants": 20,
|
||||
"assignments": 64, "placement": 64, "copies": 1, "proposals": 5, "candidates": 5, "pulses": 0, "findings": 5, "policies": 20, "seat-holders": 5, views.MarksState: 1, views.StatusState: 1,
|
||||
"engine-reads": 1, "written": 5, "waits": 5, "put-waits": 1, "delivery-waits": 1, "delivered-again": 1, "inputs": 1, "composition-runs": 1, "pins": 5}; !reflect.DeepEqual(states, want) {
|
||||
"engine-reads": 1, "written": 5, "waits": 5, "put-waits": 1, "inputs": 1, "composition-runs": 1, "pins": 5}; !reflect.DeepEqual(states, want) {
|
||||
t.Errorf("state = %v, want %v", states, want)
|
||||
}
|
||||
if _, ok := m.OwnSecrets["broker"]; !ok || len(m.OwnSecrets) != 1 {
|
||||
@@ -105,7 +105,7 @@ func TestManifest(t *testing.T) {
|
||||
// which lists and asks again what each node's engine reads.
|
||||
if !slices.Equal(m.Tools, []string{"assigner_put", "assigner_release", "assigner_puts", "assigner_waits", "assigner_inputs", "assigner_inputs_drop", "assigner_compositions", "assigner_compositions_drop", "assignments", "seat-holders", "wants", "asks",
|
||||
"assigner_read_assignments", "assigner_read_seat_holders", "assigner_read_wants", "assigner_read_findings", "assigner_read_differences", "assigner_read_copies",
|
||||
"assigner_first_views", "assigner_first_view_again", "assigner_engine_reads", "assigner_seat_list", "assigner_seat_list_again", "assigner_ask_again", "assigner_written", "assigner_why", "assigner_pins", "assigner_unpin", "assigner_delivered_again"}) {
|
||||
"assigner_first_views", "assigner_first_view_again", "assigner_engine_reads", "assigner_seat_list", "assigner_seat_list_again", "assigner_ask_again", "assigner_written", "assigner_why", "assigner_pins", "assigner_unpin"}) {
|
||||
t.Errorf("the assigner serves tools %v, want its three put tools, three first views, six read tools, assigner_engine_reads, the seat list's two (ADR 0636 §7) assigner_ask_again (ADR 0668 §5) and assigner_why (design 47 G A-439)", m.Tools)
|
||||
}
|
||||
if m.RunsAs != m.Module || m.SecretsOwner != m.RunsAs {
|
||||
@@ -135,9 +135,10 @@ func TestManifest(t *testing.T) {
|
||||
}
|
||||
}
|
||||
// ADR 0618 §4: and it hears each node's engine say its reads changed; ADR 0636 §4 (issue 1966): and the seat list's two events;
|
||||
// issue 1966 note 151: and the teller's ask-ended, its subject the one the assigner hears; §376, §389: its own version-delivered and
|
||||
// the watchman's machine-away and machine-back, read whole at its start.
|
||||
if !slices.Equal(m.Consumes, []string{"mesh-conditions.findings-asked", "mesh-conditions.condition-raised", "mesh-conditions.condition-changed", "mesh-conditions.condition-cleared", "mesh-catalog.catalog-revision", "mesh-catalog.registration-changed", "mesh-delivery.source-moved", "mesh-catalog.version-released", "mesh-wants.version-delivered", "mesh-watchdogs.machine-away", "mesh-watchdogs.machine-back", "mesh-catalog.seat-definition-changed", "mesh-catalog.seat-definition-removed", builds.BuilderModule + "." + builds.BuildsStreamEvents, buckets.IndexerModule + ".take-in.taken", buckets.TellerModule + "." + tellerevents.AskEnded, buckets.TellerModule + ".views." + buckets.AnswersState, "mesh-pipeline-runner.pipeline-ended", "mesh-pipeline-runner.group-ended", "node-build-go.step-ended", "node-build-go.ask-taken", "node-build-go.step-progress", "node-engine.manifest-reads-changed", "node-engine.running", "mesh-delivery.pinned", "mesh-delivery.freed", "mesh-delivery.heads-replaced", "mesh-delivery.pins-stated"}) {
|
||||
// issue 1966 note 151: and the teller's ask-ended, its subject the one the assigner hears; §389: the watchman's machine-away
|
||||
// and machine-back, read whole at its start. A1/AC1 (design 47 H §750, §764): no version-delivered, delivery-waits,
|
||||
// delivered-again or assigner_delivered_again: a want waits on no dependency's delivery.
|
||||
if !slices.Equal(m.Consumes, []string{"mesh-conditions.findings-asked", "mesh-conditions.condition-raised", "mesh-conditions.condition-changed", "mesh-conditions.condition-cleared", "mesh-catalog.catalog-revision", "mesh-catalog.registration-changed", "mesh-delivery.source-moved", "mesh-catalog.version-released", "mesh-watchdogs.machine-away", "mesh-watchdogs.machine-back", "mesh-catalog.seat-definition-changed", "mesh-catalog.seat-definition-removed", builds.BuilderModule + "." + builds.BuildsStreamEvents, buckets.IndexerModule + ".take-in.taken", buckets.TellerModule + "." + tellerevents.AskEnded, buckets.TellerModule + ".views." + buckets.AnswersState, "mesh-pipeline-runner.pipeline-ended", "mesh-pipeline-runner.group-ended", "node-build-go.step-ended", "node-build-go.ask-taken", "node-build-go.step-progress", "node-engine.manifest-reads-changed", "node-engine.running", "mesh-delivery.pinned", "mesh-delivery.freed", "mesh-delivery.heads-replaced", "mesh-delivery.pins-stated"}) {
|
||||
t.Errorf("consumes = %v, want the catalog half's revisions (design 47 G §195), the teller's ask-ended, the engines' reads changed and what they run", m.Consumes)
|
||||
}
|
||||
if want := []string{"mesh-delivery-indexer.manifests", "mesh-delivery-indexer.modules",
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
"mesh-catalog.registration-changed",
|
||||
"mesh-delivery.source-moved",
|
||||
"mesh-catalog.version-released",
|
||||
"mesh-wants.version-delivered",
|
||||
"mesh-watchdogs.machine-away",
|
||||
"mesh-watchdogs.machine-back",
|
||||
"mesh-catalog.seat-definition-changed",
|
||||
@@ -139,8 +138,7 @@
|
||||
"assigner_written",
|
||||
"assigner_why",
|
||||
"assigner_pins",
|
||||
"assigner_unpin",
|
||||
"assigner_delivered_again"
|
||||
"assigner_unpin"
|
||||
],
|
||||
"state": [
|
||||
{ "name": "assignments", "history": 64 },
|
||||
@@ -162,8 +160,6 @@
|
||||
{ "name": "written", "history": 5 },
|
||||
{ "name": "waits", "history": 5 },
|
||||
{ "name": "put-waits", "history": 1 },
|
||||
{ "name": "delivery-waits", "history": 1 },
|
||||
{ "name": "delivered-again", "history": 1 },
|
||||
{ "name": "inputs", "history": 1, "max-mib": 64 },
|
||||
{ "name": "composition-runs", "history": 1, "key-ttl": true, "max-mib": 64 },
|
||||
{ "name": "pins", "history": 5, "max-mib": 4 }
|
||||
|
||||
Reference in New Issue
Block a user