You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
* update unit tests
Signed-off-by: everettraven <[email protected]>
* updates to test so far
Signed-off-by: everettraven <[email protected]>
* Small changes
Signed-off-by: Brett Tofel <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* Persist observed annotations on all status updates
Signed-off-by: Brett Tofel <[email protected]>
* GCI the file
Signed-off-by: Brett Tofel <[email protected]>
* Use TransformFunc
Unit tests not updated
Signed-off-by: Todd Short <[email protected]>
* Update operatorgroup tests to compile
Signed-off-by: Todd Short <[email protected]>
* Restore operatorgroup_test from master
Remove metadatalister
Signed-off-by: Todd Short <[email protected]>
* Remove more PartialObjectMetadata
Signed-off-by: Todd Short <[email protected]>
* Remove hashes from operator_test
Signed-off-by: Todd Short <[email protected]>
* Fix error messages for static-analysis
Signed-off-by: Todd Short <[email protected]>
* Update test annotations and test client
Signed-off-by: Todd Short <[email protected]>
* Rename pruning to listerwatcher
Signed-off-by: Todd Short <[email protected]>
* Set resync to 6h
Signed-off-by: Todd Short <[email protected]>
* Add CSV copy revert syncer
Signed-off-by: Todd Short <[email protected]>
* Log tweaks
Signed-off-by: Todd Short <[email protected]>
* Consolidate revert and gc syncers
Signed-off-by: Todd Short <[email protected]>
* Add logging and reduce the amount of metadata in the TransformFunc
Signed-off-by: Todd Short <[email protected]>
* Handle the copy CSV revert via a requeue of the primary CSV
Signed-off-by: Todd Short <[email protected]>
* Revert "Set resync to 6h"
This reverts commit 855f940a2199bd4071c51f14ef44728550bf13cf.
Signed-off-by: Todd Short <[email protected]>
* Add delete handler for copied csv
Signed-off-by: Todd Short <[email protected]>
* Revert whitespace change
Signed-off-by: Todd Short <[email protected]>
* Rename function, fix comment
Signed-off-by: Todd Short <[email protected]>
---------
Signed-off-by: everettraven <[email protected]>
Signed-off-by: Brett Tofel <[email protected]>
Signed-off-by: Todd Short <[email protected]>
Co-authored-by: everettraven <[email protected]>
Co-authored-by: Brett Tofel <[email protected]>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: d055f28750cf62f966f566d36990fff5285c7a71
(cherry picked from commit bc111a9)
(cherry picked from commit 882eb21)
(cherry picked from commit e4bc847)
Copy file name to clipboardExpand all lines: manifests/0000_50_olm_00-clusterserviceversions.crd.yaml
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ spec:
98
98
path:
99
99
type: string
100
100
value:
101
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
101
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
102
102
type: string
103
103
format: byte
104
104
x-descriptors:
@@ -154,7 +154,7 @@ spec:
154
154
path:
155
155
type: string
156
156
value:
157
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
157
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
158
158
type: string
159
159
format: byte
160
160
x-descriptors:
@@ -176,7 +176,7 @@ spec:
176
176
path:
177
177
type: string
178
178
value:
179
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
179
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
180
180
type: string
181
181
format: byte
182
182
x-descriptors:
@@ -211,7 +211,7 @@ spec:
211
211
path:
212
212
type: string
213
213
value:
214
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
214
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
215
215
type: string
216
216
format: byte
217
217
x-descriptors:
@@ -267,7 +267,7 @@ spec:
267
267
path:
268
268
type: string
269
269
value:
270
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
270
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
271
271
type: string
272
272
format: byte
273
273
x-descriptors:
@@ -289,7 +289,7 @@ spec:
289
289
path:
290
290
type: string
291
291
value:
292
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
292
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
293
293
type: string
294
294
format: byte
295
295
x-descriptors:
@@ -335,7 +335,7 @@ spec:
335
335
path:
336
336
type: string
337
337
value:
338
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
338
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
339
339
type: string
340
340
format: byte
341
341
x-descriptors:
@@ -384,7 +384,7 @@ spec:
384
384
path:
385
385
type: string
386
386
value:
387
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
387
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
388
388
type: string
389
389
format: byte
390
390
x-descriptors:
@@ -406,7 +406,7 @@ spec:
406
406
path:
407
407
type: string
408
408
value:
409
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
409
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
410
410
type: string
411
411
format: byte
412
412
x-descriptors:
@@ -440,7 +440,7 @@ spec:
440
440
path:
441
441
type: string
442
442
value:
443
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
443
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
444
444
type: string
445
445
format: byte
446
446
x-descriptors:
@@ -489,7 +489,7 @@ spec:
489
489
path:
490
490
type: string
491
491
value:
492
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
492
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
493
493
type: string
494
494
format: byte
495
495
x-descriptors:
@@ -511,7 +511,7 @@ spec:
511
511
path:
512
512
type: string
513
513
value:
514
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
514
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
Copy file name to clipboardExpand all lines: microshift-manifests/0000_50_olm_00-clusterserviceversions.crd.yaml
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ spec:
98
98
path:
99
99
type: string
100
100
value:
101
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
101
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
102
102
type: string
103
103
format: byte
104
104
x-descriptors:
@@ -154,7 +154,7 @@ spec:
154
154
path:
155
155
type: string
156
156
value:
157
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
157
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
158
158
type: string
159
159
format: byte
160
160
x-descriptors:
@@ -176,7 +176,7 @@ spec:
176
176
path:
177
177
type: string
178
178
value:
179
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
179
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
180
180
type: string
181
181
format: byte
182
182
x-descriptors:
@@ -211,7 +211,7 @@ spec:
211
211
path:
212
212
type: string
213
213
value:
214
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
214
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
215
215
type: string
216
216
format: byte
217
217
x-descriptors:
@@ -267,7 +267,7 @@ spec:
267
267
path:
268
268
type: string
269
269
value:
270
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
270
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
271
271
type: string
272
272
format: byte
273
273
x-descriptors:
@@ -289,7 +289,7 @@ spec:
289
289
path:
290
290
type: string
291
291
value:
292
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
292
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
293
293
type: string
294
294
format: byte
295
295
x-descriptors:
@@ -335,7 +335,7 @@ spec:
335
335
path:
336
336
type: string
337
337
value:
338
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
338
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
339
339
type: string
340
340
format: byte
341
341
x-descriptors:
@@ -384,7 +384,7 @@ spec:
384
384
path:
385
385
type: string
386
386
value:
387
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
387
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
388
388
type: string
389
389
format: byte
390
390
x-descriptors:
@@ -406,7 +406,7 @@ spec:
406
406
path:
407
407
type: string
408
408
value:
409
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
409
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
410
410
type: string
411
411
format: byte
412
412
x-descriptors:
@@ -440,7 +440,7 @@ spec:
440
440
path:
441
441
type: string
442
442
value:
443
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
443
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
444
444
type: string
445
445
format: byte
446
446
x-descriptors:
@@ -489,7 +489,7 @@ spec:
489
489
path:
490
490
type: string
491
491
value:
492
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
492
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
493
493
type: string
494
494
format: byte
495
495
x-descriptors:
@@ -511,7 +511,7 @@ spec:
511
511
path:
512
512
type: string
513
513
value:
514
-
description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
514
+
description: RawMessage is a raw encoded JSON value. It implements [Marshaler] and [Unmarshaler] and can be used to delay JSON decoding or precompute a JSON encoding.
0 commit comments