E2: take a compose-candidate ask once by its id
The holder of mesh-wants asks each node-engine compose-candidate as a kept call, so the same ask may come again on a transport fault. The engine reads the ask id from the request header, keeps it in its own state taken for compose-ask-bound (process.StateOver over the link it serves its seat on), and a repeat while the ask's run goes joins that run and gets the answer composed once; a repeat after the run ended is composed again, since the verb is a read and no answer is kept. The manifest declares taken with its 8 MiB cap. Builds: design 47 H2 §775, §820; H-A-351, H-A-364, H-A-383
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
package packaging_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/catalogue"
|
||||
)
|
||||
|
||||
// The node-engine's waits run against bound keys with their own time to live, in its old section as its other states are
|
||||
// (design 47 G A-92, §560, §627): the manifest declares the state bounds with a lifetime per key.
|
||||
func TestTheManifestDeclaresTheBoundsStateWithAKeyLifetime(t *testing.T) {
|
||||
raw, err := os.ReadFile("../module.json")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
m, err := catalogue.Decode(raw)
|
||||
if err != nil {
|
||||
t.Fatalf("the manifest no longer parses: %v", err)
|
||||
}
|
||||
for _, s := range m.State {
|
||||
if s.Name == "bounds" {
|
||||
if !s.KeyTTL || s.History != 1 {
|
||||
t.Fatalf("the state bounds is %+v: one value a key, each key with its own lifetime", s)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
t.Fatal("the manifest declares no state bounds")
|
||||
}
|
||||
@@ -128,11 +128,13 @@ func TestTheManifestConsumesTheBackupEvent(t *testing.T) {
|
||||
// ADR 0565 clause 6: and the state packages, one key per node, its compositions' declared packages, read by pacman.
|
||||
// ADR 0564 §2, ADR 0636 §1: and the state findings, the node's finding that it waits for the seat list (no TTL: the
|
||||
// finding stays until the first full read deletes its key).
|
||||
// Design 47 G A-92: and the state bounds, each key a wait's bound with its own lifetime (packaging/bounds_state_test.go).
|
||||
if len(parsed.State) != 5 || parsed.State[0].Name != "health" || parsed.State[0].TTLSeconds != 0 ||
|
||||
// Design 47 G A-92: and the state bounds, each key a wait's bound with its own lifetime, one value a key.
|
||||
// Design 47 H2 §775, §820, H-A-364: and the state taken, the asks taken once, each key for its ask's bound, 8 MiB.
|
||||
if len(parsed.State) != 6 || parsed.State[0].Name != "health" || parsed.State[0].TTLSeconds != 0 ||
|
||||
parsed.State[1].Name != "findings" || parsed.State[1].TTLSeconds != 0 ||
|
||||
parsed.State[2].Name != "data" || parsed.State[2].TTLSeconds != 0 || parsed.State[3].Name != "packages" ||
|
||||
parsed.State[3].TTLSeconds != 0 || parsed.State[4].Name != "bounds" {
|
||||
parsed.State[3].TTLSeconds != 0 || parsed.State[4].Name != "bounds" || !parsed.State[4].KeyTTL || parsed.State[4].History != 1 ||
|
||||
parsed.State[5].Name != "taken" || !parsed.State[5].KeyTTL || parsed.State[5].History != 1 || parsed.State[5].MaxMiB != 8 {
|
||||
t.Fatalf("the manifest declares the state %+v", parsed.State)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user