End an unassigned key with ended and remove no key of the chain (issue 1093)
ADR 0408 section 4 says no key of the chain is removed, a delete marker included. The Backend loses Remove and the Chain RemoveAssignment. An unassignment, and the end of a value only pulled in by another, write the value again with ended set, by compare-and-set; assigning it again writes a fresh standing value over it. A value with ended or a state is no assignment (Assignment.Stands) to the assignment lists, the joins, forgetting a module, seat holdings, the given values, the move and the assignment-changed event.
This commit is contained in:
+2
-15
@@ -182,20 +182,8 @@ type Chain struct {
|
||||
Rollouts Bucket[Rollout]
|
||||
Assignments Bucket[Assignment]
|
||||
|
||||
rollouts Backend
|
||||
assignments Backend
|
||||
holds Holds
|
||||
}
|
||||
|
||||
// RemoveAssignment ends an assignment's key with a marker, at the revision it was read at, only by a controller that holds
|
||||
// the lease. **The one removal the chain has**, for an unassignment in the delivery that moves the assignments: the
|
||||
// key's earlier values stay (history), and nothing is purged. The delivery after it keeps an unassigned key with an end
|
||||
// mark in its place and removes this (issue 1096). Builds and rollouts have none.
|
||||
func (c *Chain) RemoveAssignment(ctx context.Context, key string, revision uint64) error {
|
||||
if err := c.Assignments.guard(ctx, key, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
return c.assignments.Remove(ctx, key, revision)
|
||||
rollouts Backend
|
||||
holds Holds
|
||||
}
|
||||
|
||||
// RolloutsOf is the rollouts bucket typed as the controller's plan, which carries more than the chain's Rollout names:
|
||||
@@ -209,7 +197,6 @@ func New(builds, rollouts, assignments Backend, holds Holds) *Chain {
|
||||
Rollouts: Bucket[Rollout]{rollouts, holds},
|
||||
Assignments: Bucket[Assignment]{assignments, holds},
|
||||
rollouts: rollouts,
|
||||
assignments: assignments,
|
||||
holds: holds,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user