Skip to content

Commit

Permalink
Add note about consistency concerns (kubernetes#8295)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed May 22, 2015
1 parent ebf0499 commit 47b1278
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/registry/service/ipallocator/controller/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ func (c *Repair) RunUntil(ch chan struct{}) {

// RunOnce verifies the state of the portal IP allocations and returns an error if an unrecoverable problem occurs.
func (c *Repair) RunOnce() error {
// TODO: (per smarterclayton) if Get() or ListServices() is a weak consistency read,
// or if they are executed against different leaders,
// the ordering guarantee required to ensure no IP is allocated twice is violated.
// ListServices must return a ResourceVersion higher than the etcd index Get triggers,
// and the release code must not release services that have had IPs allocated but not yet been created
// See #8295

latest, err := c.alloc.Get()
if err != nil {
return fmt.Errorf("unable to refresh the service IP block: %v", err)
Expand Down
7 changes: 7 additions & 0 deletions pkg/registry/service/portallocator/controller/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ func (c *Repair) RunUntil(ch chan struct{}) {

// RunOnce verifies the state of the portal IP allocations and returns an error if an unrecoverable problem occurs.
func (c *Repair) RunOnce() error {
// TODO: (per smarterclayton) if Get() or ListServices() is a weak consistency read,
// or if they are executed against different leaders,
// the ordering guarantee required to ensure no IP is allocated twice is violated.
// ListServices must return a ResourceVersion higher than the etcd index Get triggers,
// and the release code must not release services that have had IPs allocated but not yet been created
// See #8295

latest, err := c.alloc.Get()
if err != nil {
return fmt.Errorf("unable to refresh the port block: %v", err)
Expand Down

0 comments on commit 47b1278

Please sign in to comment.