Node-engine: judge a move's data forms from the entry kept of the running build; no endless handing again
The running build's entry stays held (kept in the composition state) while the node runs it, though the catalog half dropped it; the agent no longer tells the composer it waits for a composition it holds, and the composer hands again when the entry answers. Builds: design 47 G §296, §297, A-113, §614
This commit is contained in:
@@ -30,6 +30,7 @@ type recoveryFake struct {
|
||||
catchUp []meshrecovery.CatchUp
|
||||
expired chan struct{}
|
||||
unknown error // FormChanges answers it
|
||||
waited int // times the agent told the composer it waits for a composition
|
||||
}
|
||||
|
||||
type fakeAnswer struct {
|
||||
@@ -110,6 +111,7 @@ func moveDB(t *testing.T, f *recoveryFake, ranFrom, to string, settle func(b *be
|
||||
}
|
||||
f.events, f.expired = make(chan Ending, 16), make(chan struct{})
|
||||
b.env.Recovery = f.env()
|
||||
b.env.Waiting = func(string, string) { f.mu.Lock(); f.waited++; f.mu.Unlock() }
|
||||
b.env.Stop = func(context.Context, string) Result {
|
||||
f.mu.Lock()
|
||||
f.calls = append(f.calls, "stop")
|
||||
@@ -289,6 +291,11 @@ func testAMoveAcrossAFormChange(t *testing.T) {
|
||||
t.Run("a form change not known moves nothing and waits for the entries (A-113)", func(t *testing.T) {
|
||||
f := &recoveryFake{unknown: fmt.Errorf("the entry is asked")}
|
||||
b := moveDB(t, f, "a", "b", heldHave)
|
||||
f.mu.Lock()
|
||||
if f.waited != 0 {
|
||||
t.Errorf("the composer was told the agent waits for a composition %d times; it waits for an entry and holds the composition", f.waited)
|
||||
}
|
||||
f.mu.Unlock()
|
||||
if h := b.haves.last("db"); h.FP != fp("a") || !contains(h.Detail, "is not known") || h.Wait == nil || h.Wait.Reason != "entry-missing" {
|
||||
t.Fatalf("the have %+v", h)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user