-
Notifications
You must be signed in to change notification settings - Fork 218
Most updated CustomResource status must be passed in each reconciliation loop #2765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @afalhambra-hivemq , thx for creating an issue for this, it is already a duplicate, see issue for this: #2746 Just some remarks:
Something like this:
|
Also feel free to join our community meeting tomorrow, 15:00 CEST where we will discuss this topic. |
Using optimistic locking is already problematic for us. We have an edge case, with a race condition where the CR is updated at the same time twice, so an optimistic locking will fail straight away because of the resourceVersion being different. If I'm not mistaken, the default retry mechanism didn't work here either, cause the status of the CR there was outdated as well but I need to double check this. |
You can alyway store the response form the first update, and do the second update using that resource. |
I guess, this would mean to add a custom retry mechanism in place for that? Haven't checked out further in detail to see how this is done by the default retry mechanism by the JOSDK. |
Is your feature request related to a problem?
We are currently in the middle of migrating from JOSDK 4 to JOSDK 5.
For us it's always crucial that the CustomResource status passed to the main reconciliation loop is the most up-to-date one.
As a best practice, our operator does not manipulate/modify anything in the CustomResource other than the status, which is afterwards used in the next reconciliations to potentially trigger a particular action to act upon based on that status (such as rolling restart of the pods for example).
So what we have just noticed is that when migrating from the JOSDK 4 to JOSDK 5, this is no longer the case as we have experienced so far that sometimes this CustomResource status is outdated. Apparently there might be some informers that triggered the reconciliation loop with an old version of the CustomResource status in the cache.
And it seems that this was handled and cached internally in the JOSDK 4 here, but got removed in the JOSDK 5.
Describe the solution you'd like
I guess, there might be a couple of possible options here:
Describe alternatives you've considered
Since our operator only modify the CustomResource status, at the moment we are just updating the primary cache with the CustomResource status change in every reconciliation loop (nothing else, no Metadata, no Spec change updated in this cache).
Additional context
N/A.
The text was updated successfully, but these errors were encountered: