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
{{ message }}
Repository navigation
Syncing Event Source on Startup Before Event Processing Starts #788
Consider the following scenario (from the mysql sample):
When there is already a custom resource that represents a schema and the previous reconciliation already created the schema, just the operator crashed after, so neither the status or observed generation were updated. Now: the operator restarts, we check that if the schema is there within the EventSource cache, but the cache was not filled yet since the resource event was processed before. Therefore it tries to create the schema already exists.
To cover such race out of sync situations we should wait until with event processing until the event sources which are managing a cache are filled the cache on startup with the related resources.
So the workflow should be similar in our case, initiate a start on all event sources, wait after all of the is "synced" and start processing events after this happened.
Nota that the syncing is not that simple in some cases, the PerResourcePollingEventSource might want to for all the resources in ControllerResourceEventSource and populate the cache, before it starts.
See #794 , it basically solves the problem. But would be better to have an explicit SyncingEventSource, that would be quite big change for now.
Also we could improve the current one to start the ControllerResourceEventSource to start first, then parallel way start other event sources. Would be more efficient startup, if there are lot's of event sources..
Changed the PollingEventSource to also sync on start.
The only exception is PerResourcePollingEventSource (and inbound event source, but those cannot be solved this way), it does not sync, instead reads the resource if it's not polled yet. So no syncing is required there.
Activity
csviri commentedon Jan 6, 2022
See #794 , it basically solves the problem. But would be better to have an explicit SyncingEventSource, that would be quite big change for now.
Also we could improve the current one to start the ControllerResourceEventSource to start first, then parallel way start other event sources. Would be more efficient startup, if there are lot's of event sources..
csviri commentedon Feb 4, 2022
Changed the PollingEventSource to also sync on start.
The only exception is PerResourcePollingEventSource (and inbound event source, but those cannot be solved this way), it does not sync, instead reads the resource if it's not polled yet. So no syncing is required there.
Will close this issue for now.