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

reduce conflict retries #25091

Merged
merged 1 commit into from
May 25, 2016
Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 3, 2016

Eliminates quota admission conflicts due to latent caches on the same API server.

@derekwaynecarr

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels May 3, 2016
@deads2k deads2k force-pushed the reduce-conflicts branch from 3d0d42e to f3560fe Compare May 3, 2016 17:47
@@ -51,6 +52,11 @@ type quotaEvaluator struct {
// We track the lookup result here so that for repeated requests, we don't look it up very often.
liveLookupCache *lru.Cache
liveTTL time.Duration
// updatedQuotas holds a cache of quotas that we've updated. This is used to pull the "really latest" during back to
// back quota evaluations that touch the same quota doc. This only works because we can compare etcd resourceVersions
// for the same resource as integers. Before this change: 22 updates with 12 conflicts. after this change:
Copy link
Member

Choose a reason for hiding this comment

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

after this change: ??

@deads2k deads2k added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels May 6, 2016
@deads2k deads2k force-pushed the reduce-conflicts branch from f3560fe to 4d7188e Compare May 11, 2016 14:14
@deads2k
Copy link
Contributor Author

deads2k commented May 11, 2016

comments addressed.

@deads2k deads2k force-pushed the reduce-conflicts branch from 4d7188e to 7772095 Compare May 13, 2016 17:18
@deads2k
Copy link
Contributor Author

deads2k commented May 16, 2016

@derekwaynecarr bump


// CompareResourceVersion compares etcd resource versions. Outside this API they are all strings,
// but etcd resource versions are special, they're actually ints, so we can easily compare them.
func (a APIObjectVersioner) CompareResourceVersion(lhs, rhs runtime.Object) int {
Copy link
Member

Choose a reason for hiding this comment

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

test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

test case?

added

@derekwaynecarr derekwaynecarr added this to the v1.3 milestone May 17, 2016
@deads2k deads2k force-pushed the reduce-conflicts branch 2 times, most recently from 3bde19a to 8980637 Compare May 23, 2016 11:50
@@ -70,8 +70,15 @@ func NewResourceQuota(client clientset.Interface, registry quota.Registry, numEv
}, nil
}

var runningTotal time.Duration
Copy link
Member

Choose a reason for hiding this comment

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

is this left over debugging?

i dont see it used anywhere...

@derekwaynecarr
Copy link
Member

A few requests, and I am wondering if we can have the look-aside cache get purged somewhere else or via a TTL such that if a namespace or quota is purged, they are not left lingering in the look-aside cache. Let me know if I am mistaking anything. This is a good bug fix, so I see no issue getting it in 1.3.

@deads2k deads2k force-pushed the reduce-conflicts branch from 8980637 to 02c0181 Compare May 23, 2016 17:37
@derekwaynecarr
Copy link
Member

LGTM, thanks!

@derekwaynecarr derekwaynecarr added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2016
@deads2k
Copy link
Contributor Author

deads2k commented May 23, 2016

@k8s-bot test this please issue #26112

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented May 25, 2016

GCE e2e build/test passed for commit 02c0181.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit e5cb165 into kubernetes:master May 25, 2016
@deads2k deads2k deleted the reduce-conflicts branch September 6, 2016 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants