Skip to content
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

Stale Cache on Fast Reconcile #74

Merged

Conversation

razo7
Copy link
Member

@razo7 razo7 commented Aug 14, 2023

Sometime status is not updated on a fast reconcile, after a reconcile ends a new reconcile occur immediately (ctrl.Result{Requeue: true}), due to stale cache. To overcome it we add the LastUpdateTime field to status so we can use it for comparing far object CR from the beginning of the reconcile and the latest (which is supposed to have the updated status).

Similar PR from NHC - medik8s/node-healthcheck-operator#245
ECOPROJECT-1523 ECOPROJECT-1411

@razo7
Copy link
Member Author

razo7 commented Aug 14, 2023

/retest

1 similar comment
@razo7
Copy link
Member Author

razo7 commented Aug 14, 2023

/retest

@slintes
Copy link
Member

slintes commented Aug 15, 2023

/hold

let's consider a better way for dealing with stale cache on quick requeue

@razo7 razo7 force-pushed the requeue-reconcile-with-offset branch from e8ba7cf to 5808b39 Compare August 16, 2023 14:30
@razo7 razo7 changed the title Add offset to requeues in Reconcile Stale Cache on Fast Reconcile Aug 16, 2023
After adding a finalizer, and a successful FA we immediately requeue Reconcile. We also log conflict and failing status update and a reason on any updateConditions call
We update this field when any condition value has been changed. Moreover, we can check that field to verify that the status was updated correctly at the end of reconcile by see an offset between their time
@razo7
Copy link
Member Author

razo7 commented Aug 17, 2023

/retest

Wait until the cache is updated in order to prevent reading a stale status in the next reconcile and making wrong decisions based on it. We verify that using the LastUpdateTime value of the far object from the beginning of the reconcile and now, the latest version of the CR
@razo7 razo7 force-pushed the requeue-reconcile-with-offset branch from b64a565 to fbaecd2 Compare August 17, 2023 12:59
String can result in anything and contains the unit, which you print yourself already
@openshift-ci openshift-ci bot added the lgtm label Aug 17, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: razo7, slintes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@slintes
Copy link
Member

slintes commented Aug 17, 2023

/hold cancel

@razo7
Copy link
Member Author

razo7 commented Aug 18, 2023

/retest

@openshift-merge-robot openshift-merge-robot merged commit 3e0294e into medik8s:main Aug 18, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants