| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR refactors the “read cache after write / filter only own updates” logic into dedicated event-filtering classes and expands coverage with new regression/integration tests for tricky timing scenarios (external updates during own writes, concurrent delete vs status update, etc.) in the operator framework’s informer/controller event pipelines.
Changes:
Copilot reviewed 34 out of 34 changed files in this pull request and generated 5 comments.
Show a summary per file| File | Description |
|---|---|
| pom.xml | Adds a commented Fabric8 client SNAPSHOT override line. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/readownupdates/ReadOwnUpdatesStatus.java | Renames/moves the status model into the new readownupdates package. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/readownupdates/ReadOwnUpdatesReconciler.java | Renames/moves reconciler and adapts types to ReadOwnUpdates* classes. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/readownupdates/ReadOwnUpdatesIT.java | Renames/moves IT and updates references to new reconciler/CR types. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/readownupdates/ReadOwnUpdatesCustomResource.java | Renames/moves CR class and updates short name/type parameters. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/filterpatchevent/FilterPatchEventTestReconciler.java | Moves test reconciler into readcacheafterwrite package and updates static import. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/filterpatchevent/FilterPatchEventTestCustomResourceStatus.java | Moves status class into readcacheafterwrite package. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/filterpatchevent/FilterPatchEventTestCustomResource.java | Moves CR class into readcacheafterwrite package. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/filterpatchevent/FilterPatchEventIT.java | Moves IT into readcacheafterwrite package. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalupdateduringownupdate/ExternalUpdateDuringOwnUpdateStatus.java | New status model for external-update-during-own-update IT. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalupdateduringownupdate/ExternalUpdateDuringOwnUpdateReconciler.java | New reconciler to coordinate a status patch while an external label update occurs. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalupdateduringownupdate/ExternalUpdateDuringOwnUpdateIT.java | New IT validating external updates aren’t incorrectly filtered during own write windows. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalupdateduringownupdate/ExternalUpdateDuringOwnUpdateCustomResource.java | New CR type for the external-update-during-own-update scenario. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalsecondaryupdate/ExternalSecondaryUpdateStatus.java | New status model for external secondary update scenario. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalsecondaryupdate/ExternalSecondaryUpdateReconciler.java | New reconciler exercising secondary SSA updates with external metadata changes between them. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalsecondaryupdate/ExternalSecondaryUpdateIT.java | New IT ensuring external secondary events propagate and are visible via merged caches. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/externalsecondaryupdate/ExternalSecondaryUpdateCustomResource.java | New CR type for the external-secondary-update scenario. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/deletionduringstatusupdate/DeletionDuringStatusUpdateStatus.java | New status model for deletion-during-status-update regression scenario. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/deletionduringstatusupdate/DeletionDuringStatusUpdateReconciler.java | New reconciler that patches status while delete races, to reproduce regression. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/deletionduringstatusupdate/DeletionDuringStatusUpdateIT.java | New IT verifying cleanup is triggered when delete races with a status update. |
| operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/readcacheafterwrite/deletionduringstatusupdate/DeletionDuringStatusUpdateCustomResource.java | New CR type for deletion-during-status-update scenario. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/TemporaryResourceCacheTest.java | Updates unit tests to new filtering API and adds new regression assertions. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java | Reworks informer event source tests for the new filtering model and behaviors. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/EventFilterWindowTest.java | New unit test suite for EventFilterWindow behavior. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/EventFilterSupportTest.java | New unit tests for EventFilterSupport orchestration and lifecycle. |
| operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/controller/ControllerEventSourceTest.java | Updates controller event-source tests to new filtering semantics and expected propagation. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/TemporaryResourceCache.java | Refactors temp cache to delegate filtering to EventFilterSupport and emit GenericResourceEvent. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSource.java | Updates the event-filtering update wrapper to use the new GenericResourceEvent path. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSource.java | Updates add/update/delete handling to work with Optional event emission/defer semantics. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/GenericResourceEvent.java | Renames/repurposes the prior event type and adds delete “unknown state” support. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/EventFilterWindow.java | New implementation encapsulating filter-window state + synthesis logic. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/EventFilterSupport.java | New support class coordinating windows per resource ID. |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/EventFilterDetails.java | Removes the previous EventFilterDetails implementation (replaced by the new classes). |
| operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/controller/ControllerEventSource.java | Updates controller event path to use Optional events from the new temp-cache filter. |
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/GenericResourceEvent.java:30
Sorry, something went wrong.
There was a problem hiding this comment.
Copilot reviewed 34 out of 34 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/GenericResourceEvent.java:49
Sorry, something went wrong.
There was a problem hiding this comment.
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/GenericResourceEvent.java:49
Sorry, something went wrong.
There was a problem hiding this comment.
Copilot reviewed 41 out of 41 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/GenericResourceEvent.java:31
Sorry, something went wrong.
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
### What changes were proposed in this pull request? This PR aims to upgrade `java-operator-sdk` to 5.3.5. ### Why are the changes needed? To bring the latest bug fixes and improvements from `java-operator-sdk` 5.3.5: - https://github.com/operator-framework/java-operator-sdk/releases/tag/v5.3.5 - operator-framework/java-operator-sdk#3383 - operator-framework/java-operator-sdk#3414 - operator-framework/java-operator-sdk#3365 - operator-framework/java-operator-sdk#3382 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 Closes #712 from dongjoon-hyun/SPARK-57508. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
The test captured the reconcile execution count while the create-triggered reconcile cascade was still running (the first await only checked that the ConfigMap and Secret existed, not that the system had quiesced), and asserted an exact +2 executions after the external replace. The reconciler re-writes the ConfigMap/Secret on every execution, so the number of self-induced reconciles is timing-dependent, and after the read-after-write filtering rework (#3414) the reconciler's own follow-up write is filtered, so a deterministic +2 no longer holds. Wait for the execution count to stabilize before capturing the baseline, and assert only a lower bound (at least one more execution) after the replace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
### What changes were proposed in this pull request? This PR aims to upgrade `java-operator-sdk` to 5.3.5. ### Why are the changes needed? To bring the latest bug fixes and improvements from `java-operator-sdk` 5.3.5: - https://github.com/operator-framework/java-operator-sdk/releases/tag/v5.3.5 - operator-framework/java-operator-sdk#3383 - operator-framework/java-operator-sdk#3414 - operator-framework/java-operator-sdk#3365 - operator-framework/java-operator-sdk#3382 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 4.8 Closes apache#712 from dongjoon-hyun/SPARK-57508. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
The test captured the reconcile execution count while the create-triggered reconcile cascade was still running (the first await only checked that the ConfigMap and Secret existed, not that the system had quiesced), and asserted an exact +2 executions after the external replace. The reconciler re-writes the ConfigMap/Secret on every execution, so the number of self-induced reconciles is timing-dependent, and after the read-after-write filtering rework (#3414) the reconciler's own follow-up write is filtered, so a deterministic +2 no longer holds. Wait for the execution count to stabilize before capturing the baseline, and assert only a lower bound (at least one more execution) after the replace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
The test captured the reconcile execution count while the create-triggered reconcile cascade was still running (the first await only checked that the ConfigMap and Secret existed, not that the system had quiesced), and asserted an exact +2 executions after the external replace. The reconciler re-writes the ConfigMap/Secret on every execution, so the number of self-induced reconciles is timing-dependent, and after the read-after-write filtering rework (#3414) the reconciler's own follow-up write is filtered, so a deterministic +2 no longer holds. Wait for the execution count to stabilize before capturing the baseline, and assert only a lower bound (at least one more execution) after the replace. Signed-off-by: Attila Mészáros <a_meszaros@apple.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Reworks how the framework filters watch events caused by the controller's own writes. The previous "expect this single RV" approach couldn't handle concurrent writes, foreign updates between two of our writes, mid-window deletes,
or relist gaps. It is replaced with a per-resource event-filter window driven by an explicit state machine.
Components
- TemporaryResourceCache (TRC) — caches the response of our own writes so the next read serves the up-to-date resource; also gates event delivery while a write is in flight.
- EventFilterSupport — keeps one EventFilterWindow per ResourceID. Routes lifecycle calls (startEventFilteringModify / doneEventFilterModify / processEvent, relist start/finish, ghost cleanup) and disposes empty windows.
- EventFilterWindow — the algorithm. Holds two RV-keyed sorted structures plus an activeUpdates counter and a reListOnGoing flag:
- ownResourceVersions — RVs returned from our writes
- relatedEvents — informer events for this resource, tagged partOfReList if relist is ongoing
- GenericResourceEvent — richer event carrier (action, current, previous, lastStateUnknown, partOfReList) so the framework can synthesize realistic ADD/UPDATE/DELETE events.
- ManagedInformerEventSource.eventFilteringUpdateAndCacheResource — the single funnel for caching writes (status patch, internal SSA, context.resourceOperations()). Opens the window, runs the update, records the response RV, asks the
- InformerEventSource.handleEvent — the synthesized-event delivery point. Now also updates the secondary→primary index on DELETED so synthesized deletes don't leave stale tombstones.
Window decision rules (EventFilterWindow.check)window what to surface on close.
- No related events → nothing to surface.
- No active writes & no own RVs → flush every buffered event (no filtering contribution).
- DELETE arrived but no own RV yet → surface the DELETE; resource is gone.
- Own RVs ≤ last event RV → echoes for some prefix of own writes. If events.keys() == ownRVs and no relist tag, the window is a pure own echo and is filtered. Exception: a trailing DELETED is still surfaced (we wrote, then someone
- Foreign mixed in → synthesize a single UPDATED whose previousResource is the pre-window snapshot and resource is the latest known state. One reconciliation, faithful before/after.
- Relist in progress → events tagged partOfReList are never silently filtered; relist may hide events, so we err on the side of surfacing.
Ghost cleanupdeleted).
Resources can sit in the TRC for which the informer never delivers any watch event (created then immediately deleted by a third party while the informer's watch was disconnected). TemporaryResourceCache.checkGhostResources(), triggered
from onList, sweeps the TRC: anything stale relative to lastSyncResourceVersion and absent from the informer cache is removed and surfaced as a synthetic DELETED via handleEvent — which is precisely the path that needed
primaryToSecondaryIndex.onDelete.
Sequence — own write + foreign update interleave
The window collapses an own write (RV 100) and a foreign write (RV 101) into one synthesized UPDATED — instead of silencing the foreign change or firing twice (self-loop).
Notes
OnRelistFilterIT is @Disabled.