pkg/controller
Matt Moore 1a3a36a996 Rework how we GlobalResync. (#597)
* Rework how we GlobalResync.

This consolidates the logic for how we do GlobalResyncs in a few ways:
1. Remove SendGlobalUpdates and replace it with FilteredGlobalResync.
2. Have GlobalResync go through the FilteredGlobalResync with a tautological predicate.
3. Change the way we enqueue things during a global resync to avoid flooding the system
   by using EnqueueAfter and wait.Jitter to stagger how things are queued.

The background for this is that when I started to benchmark reconciliation of a large
number of resources we'd see random large stalls like [this](https://mako.dev/run?run_key=4882560844824576&~dl=1&~cl=1&~rl=1&~rvl=1&~il=1&~sksl=1&~pal=1)
fairly consistently.  Looking at the logs, these stalls coincide with incredibly deep
work queues due to global resyncs triggers by configmap notifications. When I disabled
global resyncs the spikes [went away](https://mako.dev/run?run_key=4975897060835328&~dl=1&~cl=1&~rl=1&~rvl=1&~il=1&~sksl=1&~pal=1).

To mitigate the huge pile-up due to the global resync we use `wait.Jitter` to stagger how
things are enqueued with a `maxFactor` of the length of the store.  This also seems to
[keep things flowing](https://mako.dev/run?run_key=5701802099998720&~dl=1&~cl=1&~rl=1&~rvl=1&~il=1&~sksl=1&~pal=1),
although we will possibly need to tune things further.

* Update comment to mention the delay.
2019-08-24 21:23:13 -07:00
..
testing Migrate pkg to use the knative.dev/pkg import path (#489) 2019-06-26 13:02:06 -07:00
OWNERS Update OWNERS to use OWNERS_ALIASES (#422) 2019-05-29 20:04:33 -07:00
controller.go Rework how we GlobalResync. (#597) 2019-08-24 21:23:13 -07:00
controller_test.go Rework how we GlobalResync. (#597) 2019-08-24 21:23:13 -07:00
helper.go Rework how we GlobalResync. (#597) 2019-08-24 21:23:13 -07:00
helper_test.go Rework how we GlobalResync. (#597) 2019-08-24 21:23:13 -07:00
stats_reporter.go golang format tools (#497) 2019-06-27 07:37:08 -07:00
stats_reporter_test.go Let the stats reporter tests run with -count=N (#486) 2019-06-23 20:12:02 -07:00