Skip to content

Commit

Permalink
service: Use initNextID in acquireLocalID()
Browse files Browse the repository at this point in the history
When rolling over, it should use initNextID instead of FirstFreeServiceID,
which doesn't belong to the IDAllocator. This would create problems if
FirstFreeServiceID and FirstFreeBackendID have different values although now
they happen to be the same.

Fixes: ab9cf4b ("service: Make local ID allocator more service agnostic")
Signed-off-by: Han Zhou <hzhou8@ebay.com>
  • Loading branch information
hzhou8 authored and tklauser committed Oct 15, 2020
1 parent cbe9182 commit b34e5d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/service/id_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (alloc *IDAllocator) acquireLocalID(svc loadbalancer.L3n4Addr, desiredID ui
if alloc.nextID == startingID && rollover {
break
} else if alloc.nextID == alloc.maxID {
alloc.nextID = FirstFreeServiceID
alloc.nextID = alloc.initNextID
rollover = true
}

Expand Down

0 comments on commit b34e5d8

Please sign in to comment.