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

mutated cache filter #9342

Merged
merged 4 commits into from
Jun 22, 2016
Merged

mutated cache filter #9342

merged 4 commits into from
Jun 22, 2016

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jun 15, 2016

Last two commits. This makes it possible to avoid getting back a stale object if you're the client that updated that same object.

@liggitt @derekwaynecarr @smarterclayton I could actually make this a generic filter sitting on top of an indexer used by a SharedIndexInformer if we wanted to trust people to ONLY called Mutation when they've gotten back a confirmed correct object from Update. There's certainly some utility to such an approach, but it does require some trust.

return kapierrors.NewConflict(api.Resource("serviceaccount"), staleServiceAccount.Name, fmt.Errorf("cannot add reference to %s based on stale data. decision made for %v,%v, but live version is %v,%v", dockercfgSecretName, staleDockercfgMountableSecrets.List(), staleImageDockercfgPullSecrets.List(), mountableDockercfgSecrets.List(), imageDockercfgPullSecrets.List()))
}
// I saw conflicts popping up. Need to retry at least once, I chose five at random.
for i := 0; i < 5; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use RetryOnConfilct

@deads2k deads2k force-pushed the mutated-cache branch 2 times, most recently from 3773562 to 5d0c2c0 Compare June 16, 2016 18:49
@deads2k
Copy link
Contributor Author

deads2k commented Jun 16, 2016

[test]

} else {
// if we had an error it means that we didn't handle it, which means that we want to requeue the work
utilruntime.HandleError(fmt.Errorf("error syncing service, it will be retried: %v", err))
e.queue.AddRateLimited(key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max number of retries?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max number of retries?

Unless we flag permanent failures, we'll just pick up on the next resync. I wasn't prepared to say that.

Copy link
Contributor

@liggitt liggitt Jun 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you put a max number of retries, we'll accumulate requeues for every add/update/resync of a service account with a permanent failure

} else {
// if we had an error it means that we didn't handle it, which means that we want to requeue the work
if e.queue.NumRequeues(key) > MaxRetriesBeforeResync {
e.queue.Forget(key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HandleError here with a message about it not being retried

@liggitt
Copy link
Contributor

liggitt commented Jun 20, 2016

nit on retry logging, LGTM otherwise

@deads2k
Copy link
Contributor Author

deads2k commented Jun 20, 2016

@0xmichalis
Copy link
Contributor

@deads2k maybe so, maybe no, please open a separate issue and assign it to me.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 20, 2016

re[test] flake: #9443

@deads2k
Copy link
Contributor Author

deads2k commented Jun 21, 2016

yum [merge]

@liggitt
Copy link
Contributor

liggitt commented Jun 21, 2016

failed again on yum. want to pick https://github.com/openshift/ose/commit/bae93d0b280a0c7e29dfcf6e829c144dc01e419c before remerging?

@deads2k
Copy link
Contributor Author

deads2k commented Jun 21, 2016

failed again on yum. want to pick openshift/ose@bae93d0 before remerging?

[merge]

@deads2k
Copy link
Contributor Author

deads2k commented Jun 22, 2016

#5448 re[merge] re[test]

@derekwaynecarr
Copy link
Member

@deads2k are there other controllers that you had as candidate for this cache type?

@deads2k
Copy link
Contributor Author

deads2k commented Jun 22, 2016

@deads2k are there other controllers that you had as candidate for this cache type?

Greedy. You think kube is controlled enough to have this as a layer in front of their stores and indexes overall? This is the same trick I used in quota, so clearly that's a candidate.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 22, 2016

#9364
re[merge] re[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 78dc03c

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5239/)

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 22, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5239/) (Image: devenv-rhel7_4437)

@deads2k
Copy link
Contributor Author

deads2k commented Jun 22, 2016

#5448
re[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 78dc03c

@openshift-bot openshift-bot merged commit bb54203 into openshift:master Jun 22, 2016
}

// worker_inner returns true if the worker thread should continue
func (e *DockercfgController) worker_inner() bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/worker_inner/innerWorker or any other camelCase name, please.

@deads2k deads2k deleted the mutated-cache branch September 6, 2016 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants