Harish Kuna
5e9ddf231e
Fix -Consistent paginated lists serve from cache
...
Kubernetes-commit: d4a4a1d881ea46857afe67d3ca89d106fa59c6b1
2025-06-05 20:38:07 +00:00
Wojciech Tyczyński
b9e86eb851
Fix race for sending errors in watch
...
Kubernetes-commit: c8c2844aaf1d04835624ff2d46417492e10dec11
2025-03-24 14:02:07 +01:00
Jordan Liggitt
1776f0c3f2
Parallelize cacher list tests
...
Kubernetes-commit: eca90dab3f553c5794e780c67e17ae75d9acb65b
2025-03-31 15:17:04 -04:00
Marek Siarkowicz
e228aeaf39
Don't start etcd for skipped test
...
Kubernetes-commit: 1a15d582ae5fc84177f305d93ff473cca5de6f93
2025-03-31 21:06:54 +02:00
Marek Siarkowicz
29a5d82129
Stop cacher in TestWatchStreamSeparation to speed up shutdown
...
Kubernetes-commit: 75186095c58630fde0b3f89892c69c8ef91fffab
2025-03-31 21:28:21 +02:00
Marek Siarkowicz
30b60eb0a6
Fix flake, non-consistent list doesn't give any guarantees about staleness
...
Kubernetes-commit: 38d5cb368dd95b7f185dbba97fc3e193f48a83f2
2025-03-31 08:10:42 +02:00
Marek Siarkowicz
aed144f141
Ensure that cacher is terminated in TestGetListRecursivePrefix
...
Kubernetes-commit: 9b5c4504ee49c366be3d7c806482ef4665dc5f70
2025-03-31 18:17:08 +02:00
Marek Siarkowicz
6811fdeb2d
Unify should delegate list
...
Kubernetes-commit: 8fdd6fe4768d81da09f339c1dda831a05bb26f00
2025-03-20 11:08:37 +01:00
Marek Siarkowicz
5a059075db
Serve LISTs with exact RV and continuations from cache
...
Kubernetes-commit: f82c9e56d928d1028d4b298578f275a2e5e69490
2024-07-03 21:36:51 +02:00
Marek Siarkowicz
fa558b198a
Create Snapshotter interface to fake the implementation
...
Kubernetes-commit: 3edeb60c089106229b582a8c6800388de433426a
2025-03-19 14:04:47 +01:00
Marek Siarkowicz
91724cfd41
Change precedence order for continue and legacy exact match
...
This doesn't matter for shouldDelegateList, but matters when picking
source of RV. RV from continue takes precedence.
Kubernetes-commit: 7da942ca7486310893d4f11f3af062957f953555
2025-03-19 13:58:43 +01:00
Marek Siarkowicz
edd1d1f6ba
Extend shouldDelegateList testing incorportating state of cacher
...
Kubernetes-commit: 929a9c0cad9b5c2c411a325fd4f356a2b5e01f13
2025-03-19 12:23:08 +01:00
Marek Siarkowicz
50f48ce4b3
Implement watchcache returning error from etcd that caused cache reinitialization
...
Kubernetes-commit: c09d87f79c90a5ebb0ef6a99abd13dec82b497e3
2025-03-18 16:48:33 +01:00
Marek Siarkowicz
c59961a007
Test continue with negative RV for reading consistent RV
...
Kubernetes-commit: 6d21d8f2376b6e25064b10148b4f416e8d89a508
2025-03-17 12:10:54 +01:00
Marek Siarkowicz
4da0062093
Fix missing recursive in consistency check, enable panic on failed check and fix typo in logs
...
Kubernetes-commit: 4f1912abf2d139c57036c5333f62bd5bddd289fe
2025-03-17 19:24:16 +01:00
Marek Siarkowicz
cc5ef43352
Extract delegator.Helper interface to allow making delegate decision based on cache state
...
Kubernetes-commit: 984b475e74904dd61c10b23472798a21496edc8f
2025-03-17 15:46:02 +01:00
Marek Siarkowicz
7a33f524c6
Use ValidateListOptions in watch cache
...
Kubernetes-commit: 9e7c080b863896ffbe9eff2a7edc63aa72ec30cf
2025-03-10 14:29:24 +01:00
Marek Siarkowicz
6f6da8e97b
Add test cases for negative resource version in TestList
...
Kubernetes-commit: c4d77a07993302057441a886125c1c887e7869f1
2025-03-14 12:22:17 +01:00
Marek Siarkowicz
a67992576e
Test bypass for negative RV
...
Kubernetes-commit: 58d9b5c7b6467bb2cb14d49247cdada02e8f4a83
2025-03-14 14:34:43 +01:00
Marek Siarkowicz
3a2e1b53e5
Simplify bypass test by just testing shouldDelegateList function
...
Kubernetes-commit: d263344a9b400890409166c5823598a92bbb79fb
2025-03-14 14:26:44 +01:00
Marek Siarkowicz
6ace22f694
Fix flaky RunTestConsistentList
...
Noticed that cache might not nesseserly observe the write causing test
to flake. Fixed that changing the logic to require LessOrEqual of
writeRV instead of equal to writeRV. Also added comments explaining
edge cases.
Kubernetes-commit: 86169a7a1e09c120cadafc0213afbf9630f0d8af
2025-03-14 13:45:55 +01:00
Marek Siarkowicz
f76f81aa6f
Test recursive in TestGetListCacheBypass and separate overrides
...
Kubernetes-commit: 6d3bff83213b35797b23e89c90bfe939dd30c2cd
2025-03-04 20:07:41 +01:00
Marek Siarkowicz
3cb2448d98
Fix detecting consistent read when watchcache starts handling continue
...
Kubernetes-commit: 8f83f2446a5e2f11eb751fb56067c663b51cfd12
2025-03-12 18:37:10 +01:00
Marek Siarkowicz
36c1a58d7e
Fix typo and pass the environment variable required to enable watchcache consistency checking in GCE tests
...
Kubernetes-commit: 8b0294daed236dcaf2b2f74ad4a38405118ebbaa
2025-03-13 11:55:23 +01:00
Marek Siarkowicz
6ed423348f
Simplify shouldDelegateList
...
When ResourceVersionMatch is set to NotOlderThan, there is no need to handle continue or resourceVersion="".
The validation in apimachinery will not pass and return:
* "resourceVersionMatch is forbidden when continue is provided"
* "resourceVersionMatch is forbidden unless resourceVersion is provided"
Kubernetes-commit: a0cc02e264ead76dfb0ae75a505e4d2e54219def
2025-03-12 18:20:47 +01:00
Marek Siarkowicz
23e9b2c9d4
Implement consistency checking
...
Kubernetes-commit: e4d73c56cd055a6e3a23068bd70c424579df40fe
2025-02-27 17:53:06 +01:00
Marek Siarkowicz
73e72d16c5
Unify ListOptions validation between cache and etcd
...
Kubernetes-commit: ccb607f06b91496d02a3b94253261e03e3280630
2025-03-07 12:26:05 +01:00
Marek Siarkowicz
4305a14262
Separate compactWatchCache from increaseRV
...
Kubernetes-commit: 15cb82b3b3fa95ba5b914a5a02ac01d42eda892f
2025-02-25 14:44:50 +01:00
Marek Siarkowicz
f422062046
Pass storage.ListOptions to WaitUntilFreshAndList
...
Kubernetes-commit: e6cf9dd1663a9a54fa673873e8e97641f69bcefd
2025-02-19 11:20:04 +01:00
Marek Siarkowicz
79ec45326d
Run lists tests in subtests
...
Kubernetes-commit: 7a84e7630f91014fa3b632d8800e9a943003001c
2025-03-03 20:50:37 +01:00
Marek Siarkowicz
9e523945a2
Remove limit support from btree store
...
We cannot use limit as it would apply it before filtering, which is done
in cacher. Limit is not currently used, but let's remove it to be save,
until filtering is implemented in store.
Kubernetes-commit: 168c338f7cb44a08f3d1a7e1d0e72cac241e9a29
2025-02-25 19:17:30 +01:00
Marek Siarkowicz
3ad93853da
Move GetCurrentResourceVersion to storage.Interface
...
Kubernetes-commit: fea89f25d1bfd7290bb0165f49a6d288ab5f717a
2025-02-24 19:49:45 +01:00
Marek Siarkowicz
a4587170bd
Move watch progress to separate package.
...
Kubernetes-commit: 740db0f01d9bceaa7bd6c0b6c5e5f96fc78c04dd
2025-02-25 13:53:17 +01:00
Marek Siarkowicz
a64613cb08
Rename CacheProxy to CacheDelegator
...
Kubernetes-commit: 4c635ecf8250c7493481b9b8fb88e384de1b41db
2025-02-24 19:07:25 +01:00
Lukasz Szaszkiewicz
3aea7778be
storage/cacher/ready: dynamically calculate the retryAfterSeconds
...
retryAfterSeconds is based on the time elapsed since the state (ready, unready) was last changed.
Kubernetes-commit: 04f0bd4e83bbc0a24b8a924333544be86b252c97
2024-10-14 08:17:14 +02:00
Marek Siarkowicz
09c0e7d0cd
Add snapshotting of watch cache behind a feature gate
...
Kubernetes-commit: 2de2093bcef6544ef17c84116fbd751fc429820a
2025-02-19 17:03:48 +01:00
Marek Siarkowicz
d522031d97
Ensure that btree threadedStoreIndexer implements orderedLister
...
Kubernetes-commit: 99881453838a63730fb34b6bd02775ae08320184
2025-02-19 11:47:26 +01:00
Antoni Zawodny
efe7a1b26d
Add watch cache capacity upper bound adjusting logic
...
Kubernetes-commit: 2173a0fafd448e55b7738b88fbbab392125dd975
2025-02-21 15:07:01 +01:00
xin.li
afb79f83b3
fix wrong assertion on tests
...
Signed-off-by: xin.li <xin.li@daocloud.io>
Kubernetes-commit: bc4ae15d77beab23f321bf6547f82c04ba27c3fa
2025-02-22 12:39:01 +08:00
Marek Siarkowicz
476d81d4ba
Test continuations and exact revision LISTs
...
Kubernetes-commit: 034285dc4774f2217ca4df4626ca44b8f5f4f261
2025-02-18 17:32:41 +01:00
Marek Siarkowicz
1e6e6f0a46
Refactor TestList and validate continuations to allow testing pagination and more exact RVs in the future
...
Kubernetes-commit: 764e13e27aedfd9e304e6014af23f20b5619216b
2025-02-19 17:10:58 +01:00
张可10140699
9da16fa551
Fix non-recursive list should also read RequestWatchProgress feature when consistent list from cache is enabled
...
Kubernetes-commit: bdf2e2d0646fcb6fa56289d85222e2de0b686244
2025-02-20 08:39:36 +08:00
Lukasz Szaszkiewicz
23e8a6cc2f
cacher: decrease the running time of TestConsistentReadFallback
...
Kubernetes-commit: 601c0e359dc959bbfaf42c5d8a8a0a9a2175db74
2025-01-28 13:31:43 +01:00
Lukasz Szaszkiewicz
8a149c9296
cacher/cacher_whitebox_test: newTestCacherWithoutSyncing allow passing a clock
...
Kubernetes-commit: cfd6d9a2b4476d4256959dc2ebdd517f20191ea3
2025-01-27 19:51:35 +01:00
Marek Siarkowicz
0167eb5d20
Deprecate WatchFromStorageWithoutResourceVersion
...
Around the 1.31 release, we discovered that a change introduced in 1.27 allowead
clients to open WATCH requests directly to etcd. This had detrimental consequences,
enabling abusive clients to bypass caching and overwhelm etcd.
Unlike the API server, etcd lacks protection against such behavior.
To mitigate this, we redirected all WATCH requests to be served from the cache.
The WatchFromStorageWithoutResourceVersion feature gate was retained as an escape hatch.
However, since we have no plans to allow direct WATCH requests to etcd again,
this flag is now obsolete.
Direct WATCH requests to etcd offer no advantage, as they don't provide stronger
consistency guarantees. WATCH operations are inherently inconsistent; unlike LIST
operations, they do not confirm the resource version with a quorum. While Kubernetes
uses the WithRequireLeader option on WATCH requests to prevent maintaining connections
to isolated etcd members, the API server provides the same level of guarantee through
its health checks, which fail if it cannot connect to etcd member. Therefore,
the WatchFromStorageWithoutResourceVersion feature gate can be deprecated and removed.
Kubernetes-commit: 065bf2004d27e5e3f1be3c0f128347d4060d8954
2025-01-31 11:49:28 +01:00
Abhishek Kr Srivastav
55da1afddb
Additional timeout to receive all watchEvents
...
Kubernetes-commit: f6b527cb54e37513bbe60edb52890f3de481d000
2025-01-31 10:19:19 +05:30
Davanum Srinivas
0a703e3517
Linter to ensure go-cmp/cmp is used ONLY in tests
...
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Kubernetes-commit: 4e05bc20db99ff89b2d2205218d24b9935a7fdd7
2025-01-24 17:03:29 -05:00
张可10140699
e802cf6daf
remove duplicate getAttrsFunc calls to reduce temporary memory allocations
...
Kubernetes-commit: 479ff5a02b026caec40e8262785e8ffffb42085a
2025-01-15 10:15:02 +08:00
Marek Siarkowicz
a6c0914bb9
Only test requests that pass validation
...
Kubernetes-commit: 1b2bacda5bd978b68a6dc704606495b29b181690
2025-01-09 12:55:45 +01:00
Marek Siarkowicz
74be087390
Extract and unify cache bypass logic by creating a CacheProxy struct
...
Kubernetes-commit: 4a4fc9da801f299176c7200e66224aa79b1c0817
2024-12-31 14:04:00 +01:00