Assigner: only a put still on its steps is named when a node leaves neither list (issue 1945)
mesh/delivery merged: source.main moved to novox/mesh-delivery@c8b26735c8cf
mesh/check pass 2d841870a873 on c8b26735c8cf | carried from 1d416827157d | unit 185 run, 518 kept | integration 195 run, 584 kept | composition passed…

Review round 2: an ended put stays in the bucket and owns no want.
This commit is contained in:
2026-10-26 14:03:48 +01:00
parent f4aac599ca
commit 2d841870a8
2 changed files with 6 additions and 4 deletions
@@ -277,11 +277,12 @@ func leftNeither(into map[string]string, m assign.Module, before map[string]deli
}
}
// putOn says whether an operator's put names module m on node: it owns the node's want through its steps (ADR 0546), so the
// rules write none meanwhile.
// putOn says whether an operator's put on node owns m's want there: one still on its steps (ADR 0546), so the rules write none
// meanwhile. An ended put (done, refused, released) stays in the bucket and owns nothing.
func putOn(m assign.Module, node string) bool {
_, put := m.Puts[node]
return put
p, put := m.Puts[node]
_, owns := assign.PutOwns(p)
return put && owns
}
// startClears adds, for the first pass after a start, every node of m that is not on neither list after the pass: a neither
@@ -409,6 +409,7 @@ func TestThePassGathersTheModulesOnNeitherList(t *testing.T) {
{"a live want", nil, map[string]delivery.Want{"novox": {FP: fpTest}}, ""},
{"a put on its steps", map[string]delivery.Put{"novox": {FP: fpTest, Step: delivery.PutPerson}}, nil, "its put waits on its own steps and the operator's answer"},
{"nothing", nil, nil, "the node does not run it"},
{"an ended put", map[string]delivery.Put{"novox": {FP: fpTest, Step: delivery.PutRefused}}, nil, "the node does not run it"},
} {
left := map[string]string{}
leftNeither(left, assign.Module{Name: "nats", FP: fpTest, Nodes: []string{"novox"}, Puts: c.puts}, c.before, assign.Outcome{})