Commit Graph

59 Commits (330c9227065560c8b24c44af5dadd4cd5b84147e)

Author SHA1 Message Date
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Wojciech Tyczynski d31ff83fdc Fix bug of delivering random parts of events 2016-12-22 20:03:38 +01:00
Wojciech Tyczynski d5e235c831 Reduce timeout for waiting for resource version 2016-12-20 10:05:38 +01:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue 16a9c0b49c Merge pull request #37692 from wojtek-t/storage_resource_version_for_get
Automatic merge from submit-queue

Handle RV in Get calls to storage interface.

Ref #37473
2016-12-03 11:44:29 -08:00
Kubernetes Submit Queue 959d386ccf Merge pull request #36709 from hongchaodeng/e3
Automatic merge from submit-queue (batch tested with PRs 35300, 36709, 37643, 37813, 37697)

[etcd] test cleanup: remove unnecessary AddPrefix()

What?
Remove etcdtest.AddPrefix() in tests. They will be automatically prepended in etcd storage.

Why?
ref: #36290 #36374
After the change, it will double prepend.
2016-12-03 08:55:56 -08:00
Wojciech Tyczynski ec247315be Handle RV in Get calls to storage interface. 2016-12-03 10:18:43 +01:00
Kubernetes Submit Queue cd560926bd Merge pull request #36889 from wojtek-t/reuse_fields_and_labels
Automatic merge from submit-queue

Reuse fields and labels

This should significantly reduce memory allocations in apiserver in large cluster.
Explanation:
- every kubelet is refreshing watch every 5-10 minutes (this generally is not causing relist - it just renews watch)
- that means, in 5000-node cluster, we are issuing ~10 watches per second
- since we don't have "watch heartbets", the watch is issued from previously received resourceVersion
- to make some assumption, let's assume pods are evenly spread across pods, and writes for them are evenly spread - that means, that a given kubelet is interested in 1 per 5000 pod changes
- with that assumption, each watch, has to process 2500 (on average) previous watch events
- for each of such even, we are currently computing fields.

This PR is fixing this problem.
2016-12-02 21:49:43 -08:00
Wojciech Tyczynski 36e6cd19e1 Cache fields for filtering in watchCache. 2016-11-29 09:48:09 +01:00
Wojciech Tyczynski ac7b1065e7 Better waiting for watch event delivery in cacher 2016-11-28 09:25:33 +01:00
Hongchao Deng 1972270f7b cacher test: fix leftover v2 test server 2016-11-13 16:22:24 -08:00
Hongchao Deng 3a28b7f848 test cleanup: remove unnecessary AddPrefix() 2016-11-12 16:04:23 -08:00
Hongchao Deng 6f3ac807fd pass SelectionPredicate instead of Filter to storage layer 2016-09-26 09:47:19 -07:00
Hongchao Deng a607a69f4a pkg/storage: cleanup Codec() from interface 2016-08-15 20:46:13 -07:00
Jordan Liggitt 4fcd999c25
Fix watch cache filtering 2016-07-14 13:13:17 -04:00
Wojciech Tyczynski 1d9bc58328 Extend Filter interface with Trigger() and use it for pods and nodes 2016-07-13 08:45:18 +02:00
Wojciech Tyczynski 7f7ef0879f Change filter to interface in storage.Interface 2016-07-13 08:44:22 +02:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Clayton Coleman e5fbf86157
Allow StatusErrors to be modified after creation 2016-05-19 09:08:53 -04:00
Jordan Liggitt f80b59ba87 Return 'too old' errors from watch cache via watch stream 2016-05-10 10:59:53 -04:00
k8s-merge-robot a275a045d1 Merge pull request #23914 from sky-uk/make-etcd-cache-size-configurable
Automatic merge from submit-queue

Make etcd cache size configurable

Instead of the prior 50K limit, allow users to specify a more sensible size for their cluster.

I'm not sure what a sensible default is here. I'm still experimenting on my own clusters. 50 gives me a 270MB max footprint. 50K caused my apiserver to run out of memory as it exceeded >2GB. I believe that number is far too large for most people's use cases.

There are some other fundamental issues that I'm not addressing here:
- Old etcd items are cached and potentially never removed (it stores using modifiedIndex, and doesn't remove the old object when it gets updated)
- Cache isn't LRU, so there's no guarantee the cache remains hot. This makes its performance difficult to predict. More of an issue with a smaller cache size.
- 1.2 etcd entries seem to have a larger memory footprint (I never had an issue in 1.1, even though this cache existed there). I suspect that's due to image lists on the node status.

This is provided as a fix for #23323
2016-04-17 00:06:31 -07:00
Andy Goldstein 049e63d253 Honor starting resourceVersion in watch cache
Compare the requested resourceVersion to each event's resourceVersion to ensure events that occurred
in the past are not sent to the client.
2016-04-14 09:37:22 -04:00
Daniel Smith 4c539bf082 Merge pull request #23490 from wojtek-t/remove_set_from_storage_interface
Remove Set() from storage.Interface.
2016-04-13 14:22:05 -07:00
Jordan Liggitt ada60236f7 Make watch cache behave like uncached watch 2016-04-12 10:14:07 -04:00
James Ravn 5bb0595260 Make deserialization cache size configurable
Instead of the default 50K entries, allow users to specify more sensible
sizes for their cluster.
2016-04-12 13:42:27 +01:00
Wojciech Tyczynski 53f433f019 Remove Set() from storage.Interface. 2016-04-04 17:54:18 +02:00
Chao Xu 31b425b3a1 add delete precondition 2016-03-25 11:21:39 -07:00
Daniel Smith 3fb020b28d Fix a locking bug in the cacher. 2016-02-19 17:45:02 -08:00
Wojciech Tyczynski 20d704aa06 Fix cacher_test unit test 2016-02-18 10:25:04 +01:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
mqliang b0e06c14e5 add a knob to enable quorum read 2016-01-30 20:32:12 +08:00
Wojciech Tyczynski 60fc2bc09e Fix cacher_test flake 2015-12-31 07:53:41 +01:00
Wojciech Tyczynski 65696989b2 Extend logging for debugging 18928 2015-12-30 20:09:05 +01:00
Wojciech Tyczynski 05b60a30cf Fix flakes in cacher_test 2015-12-28 15:28:07 +01:00
Wojciech Tyczynski ec70eb16f3 Graceul termination in Cacher 2015-12-28 10:54:21 +01:00
Timothy St. Clair c505a5d49d Updating kubernetes proper to use latest etcd client library 2015-12-16 15:56:35 -06:00
Clayton Coleman 8f203a28f1 Change runtime.Object signature 2015-12-15 13:36:25 -05:00
Wojciech Tyczynski 0cefb43707 Enable listing from memory 2015-12-09 16:24:14 +01:00
Wojciech Tyczynski 793da62c7f Change resourceVersion to string in storage.Interface 2015-12-07 09:22:59 +01:00
Wojciech Tyczynski 3df5d1dbc3 Move storage-related dirs under pkg/storage. 2015-11-12 19:49:32 +01:00
Wojciech Tyczynski b6a775ca50 Terminate watcher if it is full 2015-11-06 13:40:21 +01:00
Timothy St. Clair dbdd1614e6 Fix for linkage issue with new testing utilities 2015-11-03 22:16:47 -06:00
Wojciech Tyczynski 6246201eec Remove fakeClient from cacher_test. 2015-11-03 10:58:43 +01:00
Wojciech Tyczynski 8f385c563f Refactor code for creating Cacher. 2015-11-02 20:56:46 +01:00
Wojciech Tyczynski 652fb090eb Initial support for listing from in-memory cache. 2015-10-30 20:58:13 +01:00
Timothy St. Clair 2a2a2d79ff New etcd client modifications part 1 (context support)
This commit plumbs contexts which are needed for the new client.
2015-10-12 08:45:49 -05:00
Paul Morie 227dd82119 Add PodSecurityContext and backward compatibility tests 2015-10-05 21:05:27 -04:00
Wojciech Tyczynski 907f2e9f89 Extend timeouts in cacher test 2015-09-30 08:26:58 +02:00
Daniel Martí 586cb9126a Move pkg/util.Time to pkg/api/unversioned.Time
Along with our time.Duration wrapper, as suggested by @lavalamp.
2015-09-17 17:51:27 -07:00
Wojciech Tyczynski 12eaf67acc Fix resourcVersion=0 in cacher 2015-09-15 16:17:27 +02:00