Commit Graph

6 Commits

Author SHA1 Message Date
Markus Thömmes 58be631c12
Avoid copying object if TypeMeta is already correct. (#1561)
* Avoid copying object if TypeMeta is already correct.

* Fix typos.

* Add test for the new path.
2020-07-28 00:09:58 -07:00
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
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Nghia Tran 590eb946f1 Add a version of GlobalResync that calls an event handler. (#381)
* Add a version of GlobalResync that calls an event handler.

This allows impl to apply filtering and queuing logic of their own,
instead of calling Enqueue() for everything.

* Fix typo in doc comment.
2019-04-10 13:33:59 -07:00
lichuqiang af2c4bc84e Update OnChanged in tracker to support deletion events (#160)
* define kmeta.Accessor interface

* update tracker and EnsureTypeMeta to support deletion events
2018-11-05 08:21:35 -08:00
Matt Moore 6f60c709b7 This moves a relatively pristine copy of EnsureTypeMeta into knative/pkg. (#157) 2018-11-01 17:24:34 -07:00