Revert "client: defensive against getting stale alloc updates"

This commit is contained in:
Mahmood Ali 2020-06-19 15:39:44 -04:00 committed by GitHub
parent bf08b7a890
commit 3824e0362c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 5 deletions

View File

@ -1938,9 +1938,6 @@ func (c *Client) allocSync() {
// allocUpdates holds the results of receiving updated allocations from the
// servers.
type allocUpdates struct {
// index is index of server store snapshot used for fetching alloc status
index uint64
// pulled is the set of allocations that were downloaded from the servers.
pulled map[string]*structs.Allocation
@ -2123,7 +2120,6 @@ OUTER:
filtered: filtered,
pulled: pulledAllocs,
migrateTokens: resp.MigrateTokens,
index: resp.Index,
}
select {

View File

@ -33,7 +33,7 @@ func diffAllocs(existing map[string]uint64, allocs *allocUpdates) *diffResult {
_, filtered := allocs.filtered[existID]
// If not updated or filtered, removed
if !pulled && !filtered && allocs.index > existIndex {
if !pulled && !filtered {
result.removed = append(result.removed, existID)
continue
}

0
vendor/google.golang.org/appengine/internal/regen.sh generated vendored Normal file → Executable file
View File