Serve a key's kept values so the issue tracker can carry them into its log (ADR 0307, issue 502)
mesh/delivery delivered
mesh/merge-gate pass: builds mesh-tools, node-tools → ace, g14, novox, shanks; no bus step; every machine composes with the change as it did without (4 of …
mesh/repo-check pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the change's judges the pull requests after it merges; it…
mesh/delivery-group group adr-0307-state-history delivered: every member is delivered

mesh/state.history answers every value a bucket still keeps for a key,
oldest first, to whoever may get it, by the same watch the runtime already
uses, so no new grant is needed.
This commit is contained in:
jochen
2026-10-12 10:18:34 +02:00
parent 4348b42844
commit 3f0c1a6cec
6 changed files with 219 additions and 5 deletions
+11
View File
@@ -220,6 +220,17 @@ func (m *Mesh) Pending(t *testing.T, node, module string) (ackPending, notDelive
return uint64(info.NumAckPending), info.NumPending
}
// BucketKeeping makes a module's state afresh as Bucket does, keeping up to history values a key.
func (m *Mesh) BucketKeeping(t *testing.T, name string, history uint8) nats.KeyValue {
t.Helper()
_ = m.js.DeleteKeyValue(name)
kv, err := m.js.CreateKeyValue(&nats.KeyValueConfig{Bucket: name, History: history, MaxValueSize: 256 * 1024})
if err != nil {
t.Fatal(err)
}
return kv
}
// Bucket makes a module's state afresh as the controller does from the catalogue (novox/hq ADR 0201),
// and answers it for writing what is there before a bundle starts.
func (m *Mesh) Bucket(t *testing.T, name string) nats.KeyValue {