diff --git a/modules/mesh-issues/README.md b/modules/mesh-issues/README.md index 3edb33f0..55504f01 100644 --- a/modules/mesh-issues/README.md +++ b/modules/mesh-issues/README.md @@ -256,10 +256,12 @@ whole; every other one names the fields given a new value (`set`), the lists add a note is kept as itself, not as every note again) and the fields taken away (`unset`). The fold applies them as written, so a new kind of operation needs nothing new in the fold. -**The bucket `issues` is the fold of the log**, one value per key, each issue carrying `folded`, the sequence +**The bucket `issues` is the fold of the log**, each issue carrying `folded`, the sequence of its last operation. It is written after the append, at the revision read; one whose write fails after the log took the change is behind, and caught up at its next change (the stale append is refused and the log -folded) or at the next start. Agents and views watch it as before. +folded) or at the next start. Agents and views watch it as before. It still keeps 8 values per key, so the bus +cannot drop the older values before the carry has read them; it goes to one value per key (ADR 0300 §3) in a +follow-up, once the carry has run with a read of those values. **On start**, the tracker watches its own bucket, carries what the bucket holds and the log does not (below), reads the whole log page by page, folds every issue whose last operation is newer than its `folded` — an diff --git a/modules/mesh-issues/cmd/mesh-issues/manifest_test.go b/modules/mesh-issues/cmd/mesh-issues/manifest_test.go index 655656eb..cfbd13ac 100644 --- a/modules/mesh-issues/cmd/mesh-issues/manifest_test.go +++ b/modules/mesh-issues/cmd/mesh-issues/manifest_test.go @@ -88,14 +88,15 @@ func TestItDeclaresAndHoldsTheIssueTrackerSeatOnceForTheMesh(t *testing.T) { EventTriaged, EventReady, EventReadyToVerify, EventReserved}) { t.Fatalf("emits %v", m.Emits) } - // The record is the log `changes` (ADR 0300 §1). Four states, none expiring, each one value per key: issues - // the fold of the log (§3), the counters, the backlog's pass of the duplicate check (ADR 0278 §6), each - // reserved number (issue 424). + // The record is the log `changes` (ADR 0300 §1). Four states, none expiring: issues the fold of the log (§3), + // still keeping its older values until the carry has read them (they go to one value in a follow-up), the + // counters one value each, the backlog's pass of the duplicate check one value (ADR 0278 §6), each reserved + // number one value (issue 424). if !reflect.DeepEqual(m.Logs, []string{ChangesLog}) { t.Fatalf("logs %v", m.Logs) } d := m.stateDeclarations(t) - if len(d) != 4 || d[0].Name != IssuesState || d[0].History > 1 || d[0].TTLSeconds != 0 || + if len(d) != 4 || d[0].Name != IssuesState || d[0].History < 2 || d[0].TTLSeconds != 0 || d[1].Name != CountersState || d[1].History > 1 || d[1].TTLSeconds != 0 || d[2].Name != GroomingState || d[2].History > 1 || d[2].TTLSeconds != 0 || d[3].Name != ReservationsState || d[3].History > 1 || d[3].TTLSeconds != 0 { diff --git a/modules/mesh-issues/module.json b/modules/mesh-issues/module.json index a4e96e38..8781fa9a 100644 --- a/modules/mesh-issues/module.json +++ b/modules/mesh-issues/module.json @@ -72,7 +72,7 @@ "state": [ { "name": "issues", - "history": 1 + "history": 8 }, "counters", "grooming",