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 6, 2017
1 parent 04ddedb commit b90eba2
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 123 deletions.
22 changes: 12 additions & 10 deletions glide.lock

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

3 changes: 2 additions & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import:
- package: github.com/onsi/ginkgo
version: f40a49d81e5c12e90400620b6242fb29a8e7c9
- package: github.com/Workiva/go-datastructures
version: ^1.0.39
repo: https://github.com/projectcalico/go-datastructures.git
version: f7f6abbca09533cdd1c7222e5271bc66a8d806b0
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 b90eba2

Please sign in to comment.