Skip to content

Commit

Permalink
Fix two issues that resulted in incorrect updateTypes
Browse files Browse the repository at this point in the history
- Force snapshot updates to have updateType=new, this makes sense
  because they are new to Felix even if they're the result of updates
  for Typha.  Add machinery to the FVs to check.

- The new machinery found a flake, which I tracked down to
  Workiva/go-datastructures#180
  pin go-datastructures to pick up the fix:
  Workiva/go-datastructures#182.
  • Loading branch information
fasaxc committed Nov 7, 2017
1 parent 5f55c67 commit caae1fb
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 125 deletions.
21 changes: 10 additions & 11 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ import:
- package: github.com/mipearson/rfw
- package: github.com/prometheus/client_golang
version: ^0.9.0-pre1
- package: github.com/gavv/monotime
- package: github.com/onsi/ginkgo
version: f40a49d81e5c12e90400620b6242fb29a8e7c9
- package: github.com/Workiva/go-datastructures
version: ^1.0.39
version: af7475fb23e7561c87e7c1d17c12f46d732379bb
subpackages:
- trie/ctrie
- package: golang.org/x/text
Expand Down
7 changes: 6 additions & 1 deletion pkg/snapcache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,12 @@ func (c *Cache) publishBreadcrumb() {
counterUpdatesSkipped.Inc()
continue
}
c.kvs.Insert(keyAsBytes, newUpd)
// Since the purpose of the snapshot is to hold the initial set of updates to send to Felix at start-of-day,
// all the updates that it stores should have type UpdateTypeKVNew since they're all new to Felix. Copy
// the KV and adjust it before storing it in the snapshot.
updToStore := newUpd
updToStore.UpdateType = api.UpdateTypeKVNew
c.kvs.Insert(keyAsBytes, updToStore)
}

// Record the update in the new Breadcrumb so that clients following the chain of
Expand Down
Loading

0 comments on commit caae1fb

Please sign in to comment.