[InformerController] Propagate updates that do not change the RV as resyncs to reconcilers #1084
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Changed? Why?
If an update event hits the
k8s.InformerControllerwhere the ResourceVersion of the object is unchanged, convert it into aResyncevent when propagating it to any reconcilers. This is necessary to properly propagate cache resync events as resyncs, rather than updates, as the cache resync in DeltaFIFO sends a Sync event to the processor, which gets converted into an Update event since it already exists in the cache. The event is distributed with isSync set to true, but that gets swallowed by the processor and turned into a simple update, because theOnUpdatemethod in the handler interface doesn't have a way of setting anything besides thenewandoldversion of the object. When we receive the event in theInformerControllerupdate handler, we can repeat the logic of "is the RV changed?" that the SharedInformer does to convert the event back into a Resync.How was it tested?
Unit tests have been added for reconciler Update and Sync event propagation. Also tested with a local project where cache resync was set to 30 seconds, and saw the initial add event when creating a new object, then resyncs every 30 seconds.
Where did you document your changes?
No additional documentation, as it is a bug that resync events are handled as updates.
Notes to Reviewers