kubernetes/pkg/controller
k8s-merge-robot 5643b7498f Merge pull request #25881 from jsafrane/devel/pv-add-cache
Automatic merge from submit-queue

volume controller: Add cache with the latest version of PVs and PVCs

When the controller binds a PV to PVC, it saves both objects to etcd. However, there is still an old version of these objects in the controller Informer cache. So, when a new PVC comes, the PV is still seen as available and may get bound to the new PVC. This will be blocked by etcd, still, it creates unnecessary traffic that slows everything down.

To make everything worse, when periodic sync with the old PVC is performed, this PVC is seen by the controller as Pending (while it's already Bound on etcd) and will be bound to a different PV. Writing to this PV won't be blocked by etcd, only subsequent write of the PVC fails. So, the controller will need to roll back the PV in another transaction(s). The controller can keep itself pretty busy this way.

Also, we save bound PVs (and PVCs) as two transactions - we save say PV.Spec first and then .Status. The controller gets "PV.Spec updated" event from etcd and tries to fix the Status, as it seems to the controller it's outdated. This write again fails - there already is a correct version in etcd.

As we can't influence the Informer cache, it is read-only to the controller, this patch introduces second cache in the controller, which holds latest and greatest version on PVs and PVCs to prevent these useless writes to etcd . It gets updated with events from etcd *and* after etcd confirms successful save of PV/PVC modified by the controller.

The cache stores only *pointers* to PVs/PVCs, so in ideal case it shares the actual object data with the informer cache. They will diverge only for a short time when the controller modifies something and the informer cache did not get update events yet.

@kubernetes/sig-storage
2016-05-30 04:13:18 -07:00
..
daemon Merge pull request #24908 from pmorie/daemon-controller-loc 2016-05-12 15:51:55 -07:00
deployment move server client shared annotations to new api/annotations package 2016-05-09 11:10:44 -07:00
endpoint Endpoints controller respects unready service annotation 2016-05-10 14:20:10 -07:00
framework Attach detach controller business logic added 2016-05-24 23:01:16 -07:00
garbagecollector add finalizer logics to the API server and the garbage collector; handling DeleteOptions.OrphanDependents in the API server 2016-05-24 13:07:28 -07:00
gc implement AddIndexers for SharedIndexInformer 2016-05-06 21:23:18 +08:00
job implement AddIndexers for SharedIndexInformer 2016-05-06 21:23:18 +08:00
namespace Merge pull request #25662 from deads2k/prevent-hotloop 2016-05-28 01:30:51 -07:00
node Merge pull request #26415 from wojtek-t/network_not_ready 2016-05-29 03:06:59 -07:00
persistentvolume Merge pull request #25881 from jsafrane/devel/pv-add-cache 2016-05-30 04:13:18 -07:00
petset Update use of Quantity in other classes 2016-05-19 08:41:43 -04:00
podautoscaler Use Metrics API in HPA 2016-05-20 19:50:56 +02:00
replicaset add namespace index to rc and pod 2016-05-06 17:12:36 +08:00
replication Explicitly enqueue controllers on failures and increase resync period 2016-05-16 08:52:01 +02:00
resourcequota Have quota controller use a rate limiter to avoid hot-loops 2016-05-17 11:09:30 -04:00
route Change to NotReadyNetworking and use in scheduler 2016-05-27 19:32:49 +02:00
service promote sourceRange into service spec 2016-05-26 10:42:30 -07:00
serviceaccount Generated clients can return their RESTClients, RESTClient can return its RateLimiter 2016-04-27 22:15:10 +02:00
volume Fix DATA RACE in unit tests: reconciler_test.go 2016-05-27 01:19:25 -07:00
controller_utils.go Make name validators return string slices 2016-05-18 00:48:01 -07:00
controller_utils_test.go Fix the rest of the code 2016-04-29 17:12:10 -04:00
doc.go Refactor package controller 2015-07-29 09:54:35 -07:00
lookup_cache.go Update lookup_cache.go 2016-05-16 15:26:30 +08:00
OWNERS Remove myself from a bunch of OWNERS files, as I am too overloaded 2016-05-11 13:34:51 -07:00