mirror of https://github.com/knative/pkg.git
* 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. |
||
---|---|---|
.. | ||
testing | ||
OWNERS | ||
controller.go | ||
controller_test.go | ||
helper.go | ||
helper_test.go | ||
stats_reporter.go | ||
stats_reporter_test.go |