issue 974: a rollout advances on events (a look asked by each plan saved, report and expired silent key), the 30 s ticker goes, and each tier send is said as sent

This commit is contained in:
2026-10-17 13:28:34 +02:00
parent fd522f4322
commit 8af77c2c75
13 changed files with 931 additions and 64 deletions
+12 -3
View File
@@ -180,9 +180,15 @@ func serve(ctx context.Context) (err error) {
// And build results nobody was waiting for. A build triggered any other way than `build`
// would otherwise be reported into the void, which is the same as not reporting it.
server.Records(builds{inv, open})
// Open plans move on a timer as well as on outcomes (novox/hq ADR 0162): a tier waiting for
// machines to report moves when they have, and a plan left by a replaced controller resumes.
go planTicker(ctx, open)
// Open plans move on events (novox/hq ADR 0406 §5, issue 974): a tier is asked on the `built` and the send of the
// tier before it, a walk ends on its machines' reports, a silent machine is a key that expired, and a plan left
// by a replaced controller resumes from the first look, which this asks for. No timer looks every so often.
// The wait for each machine's report is a key on the bus that expires; where the bus will not take it a timer of its
// own for that wait looks instead.
if err := startRolloutSilent(ctx, server.JetStream()); err != nil {
fmt.Printf("plans: the wait for the machines' reports could not be put on the bus (%v); each is looked at by a timer of its own\n", err)
}
startPlanLooks(ctx, open)
// And the merge window (novox/hq ADR 0276, ADR 0407): a batch is cut into its walk when the window closes,
// which no merge or outcome says. The window is two keys on the bus that expire and a watcher that hears it;
// nothing polls (issue 973).
@@ -254,6 +260,9 @@ func serve(ctx context.Context) (err error) {
// And every walk this controller keeps in a new state, for the delivery it walks (novox/hq ADR 0239).
inventory.PlanSaved = func(_ *inventory.Inventory, p inventory.Plan) {
sayPlanMoved(ctx, bus, open.inventory, p)
// And the plan's next step is looked at (ADR 0406 §5): a build, a send kept or a command's move is followed
// by the look that asks the next tier, in place of the timer that did.
planKept(p)
// A walk ended has taken what it reuses: its merges' check builds go (novox/hq ADR 0350 §5).
if p.WalkSaid == inventory.WalkEnded {
go forgetChecksOfWalk(context.WithoutCancel(ctx), open.inventory, p)