Commit d055f28
🐛 OCPBUGS-37982: Reduce Frequency of Update Requests for Copied CSVs (#3597)
* (bugfix): reduce frequency of update requests for CSVs
by adding annotations to copied CSVs that are populated with
hashes of the non-status fields and the status fields.
This seems to be how this was intended to work, but was not actually
working this way because the annotations never actually existed on the
copied CSV. This resulted in a hot loop of update requests being made
on all copied CSVs.
Signed-off-by: everettraven <everettraven@gmail.com>
* update unit tests
Signed-off-by: everettraven <everettraven@gmail.com>
* updates to test so far
Signed-off-by: everettraven <everettraven@gmail.com>
* Small changes
Signed-off-by: Brett Tofel <btofel@redhat.com>
* Add metadata drift guard to copyToNamespace
Since we switched to a PartialObjectMetadata cache to save memory, we lost visibility into copied CSV spec and status fields, and the reintroduced nonStatusCopyHash/statusCopyHash annotations only partially solved the problem. Manual edits to a copied CSV could still go undetected, causing drift without reconciliation.
This commit adds two new annotations: olm.operatorframework.io/observedGeneration and olm.operatorframework.io/observedResourceVersion. It implements a mechanism to guard agains metadata drift at the top of the existing-copy path in copyToNamespace. If a stored observedGeneration or observedResourceVersion no longer matches the live object, the operator now:
• Updates the spec and hash annotations
• Updates the status subresource
• Records the new generation and resourceVersion in the guard annotations
Because the guard only fires when its annotations are already present, all existing unit tests pass unchanged. We preserve the memory benefits of the metadata‐only informer, avoid extra GETs, and eliminate unnecessary API churn.
Future work may explore a WithTransform informer to regain full object visibility with minimal memory impact.
Signed-off-by: Brett Tofel <btofel@redhat.com>
* Tests for metadata guard
Verifies that exactly three updates (spec, status, guard) are issued when the observedGeneration doesn’t match.
Signed-off-by: Brett Tofel <btofel@redhat.com>
* Persist observed annotations on all status updates
Signed-off-by: Brett Tofel <btofel@redhat.com>
* GCI the file
Signed-off-by: Brett Tofel <btofel@redhat.com>
* Use TransformFunc
Unit tests not updated
Signed-off-by: Todd Short <todd.short@me.com>
* Update operatorgroup tests to compile
Signed-off-by: Todd Short <todd.short@me.com>
* Restore operatorgroup_test from master
Remove metadatalister
Signed-off-by: Todd Short <todd.short@me.com>
* Remove more PartialObjectMetadata
Signed-off-by: Todd Short <todd.short@me.com>
* Remove hashes from operator_test
Signed-off-by: Todd Short <todd.short@me.com>
* Fix error messages for static-analysis
Signed-off-by: Todd Short <todd.short@me.com>
* Update test annotations and test client
Signed-off-by: Todd Short <todd.short@me.com>
* Rename pruning to listerwatcher
Signed-off-by: Todd Short <todd.short@me.com>
* Set resync to 6h
Signed-off-by: Todd Short <todd.short@me.com>
* Add CSV copy revert syncer
Signed-off-by: Todd Short <todd.short@me.com>
* Log tweaks
Signed-off-by: Todd Short <todd.short@me.com>
* Consolidate revert and gc syncers
Signed-off-by: Todd Short <todd.short@me.com>
* Add logging and reduce the amount of metadata in the TransformFunc
Signed-off-by: Todd Short <todd.short@me.com>
* Handle the copy CSV revert via a requeue of the primary CSV
Signed-off-by: Todd Short <todd.short@me.com>
* Revert "Set resync to 6h"
This reverts commit 855f940.
Signed-off-by: Todd Short <todd.short@me.com>
* Add delete handler for copied csv
Signed-off-by: Todd Short <todd.short@me.com>
* Revert whitespace change
Signed-off-by: Todd Short <todd.short@me.com>
* Rename function, fix comment
Signed-off-by: Todd Short <todd.short@me.com>
---------
Signed-off-by: everettraven <everettraven@gmail.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Todd Short <todd.short@me.com>
Co-authored-by: everettraven <everettraven@gmail.com>
Co-authored-by: Brett Tofel <btofel@redhat.com>1 parent 86838d6 commit d055f28
File tree
8 files changed
+268
-171
lines changed- pkg/controller/operators
- catalog
- internal
- listerwatcher
- pruning
- olm
- plugins
8 files changed
+268
-171
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 240 | + | |
259 | 241 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
263 | 247 | | |
264 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
265 | 280 | | |
266 | 281 | | |
267 | 282 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 0 additions & 52 deletions
This file was deleted.
0 commit comments