Skip to content

Commit 92b36ca

Browse files
committed
ConsistentListFromCache mitigations
1 parent 3feb698 commit 92b36ca

File tree

1 file changed

+28
-1
lines changed
  • keps/sig-api-machinery/2340-Consistent-reads-from-cache

1 file changed

+28
-1
lines changed

keps/sig-api-machinery/2340-Consistent-reads-from-cache/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,33 @@ Since falling back to etcd won't work, we should fail the requests and rely on
253253
rate limiting to prevent cascading failure. I.e. `Retry-After` HTTP header (for
254254
well-behaved clients) and [Priority and Fairness](https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190228-priority-and-fairness.md).
255255

256+
In order to mitigate such problems, let's present how the system currently works
257+
in different cases.
258+
259+
| ResourceVersion | ResourceVersionMatch | Continuation | Limit | etcd implementation | watchcache implementation |
260+
|-----------------|----------------------|-------------------|---------------|-----------------------------------------|----------------------------------------------------|
261+
| _unset_ | _unset_ | _unset_ | _unset_ / _N_ | Quorum read request | Delegated to etcd |
262+
| _unset_ | _unset_ | _token_ | _unset_ / _N_ | Read request from RV encoded in _token_ | Delegated to etcd |
263+
| _unset_ | _Exact_ | _unset_ / _token_ | _unset_ / _N_ | Fails [validation] | Fails [validation] |
264+
| _unset_ | _NotOlderThan_ | _unset_ | _unset_ / _N_ | Quorum read request | Delegated to etcd |
265+
| _unset_ | _NotOlderThan_ | _token_ | _unset_ / _N_ | Fails [validation] | Fails [validation] |
266+
| _0_ | _unset_ | _unset_ | _unset_ / _N_ | Quorum read request | List from cache ignoring _limit_ |
267+
| _0_ | _unset_ | _token_ | _unset_ / _N_ | Quorum read request | Delegated to etcd |
268+
| _0_ | _Exact_ | _unset_ / _token_ | _unset_ / _N_ | Fails [validation] | Fails [validation] |
269+
| _0_ | _NotOlderThan_ | _unset_ | _unset_ / _N_ | Quorum read request | List from cache ignoring _limit_ |
270+
| _0_ | _NotOlderThan_ | _token_ | _unset_ / _N_ | Read request from RV encoded in _token_ | Delegated to etcd |
271+
| _RV_ | _unset_ | _unset_ | _unset_ | Quorum read request | Wait for cache synced to _RV_+ and list from cache |
272+
| _RV_ | _unset_ | _unset_ | _N_ | Read request from RV=_RV_ | Delegated to etcd |
273+
| _RV_ | _unset_ | _token_ | _unset_ / _N_ | Read request from RV encoded in _token_ | Delegated to etcd |
274+
| _RV_ | _Exact_ | _unset_ | _unset_ / _N_ | Read request from RV=_RV_ | Delegated to etcd |
275+
| _RV_ | _Exact_ | _token_ | _unset_ / _N_ | Fails [validation] | Fails [validation] |
276+
| _RV_ | _NotOlderThan_ | _unset_ | _unset_ | Quorum read request + check for _RV_ | Wait for cache synced to _RV_+ and list from cache |
277+
| _RV_ | _NotOlderThan_ | _unset_ | _N_ | Quorum read request + check for _RV_ | Delegated to etcd |
278+
| _RV_ | _NotOlderThan_ | _token_ | _unset_/ _N_ | Fails [validation] | Fails [validation] |
279+
280+
[validation]: https://github.com/kubernetes/kubernetes/blob/release-1.30/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L28
281+
[etcd resolution]: https://github.com/kubernetes/kubernetes/blob/release-1.30/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go#L589-L627
282+
256283
For such situations we will provide users with following tools:
257284
* a dedicated `apiserver_watch_cache_read_wait` metric to detect a problem with
258285
watch cache.
@@ -547,4 +574,4 @@ Allow clients to manage the initial resource version they provide to reflectors,
547574
Do a dynamic fallback based on watch cache wait time.
548575

549576
- We expect watch being starved to happen very rarely, meaning its logic needs to be very simple to ensure it works properly.
550-
- Simple fallback will rather not do a better job then just a manual fallback.
577+
- Simple fallback will rather not do a better job then just a manual fallback.

0 commit comments

Comments
 (0)