-
Notifications
You must be signed in to change notification settings - Fork 40k
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
reduce conflict retries #25091
Conversation
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after this change: ??
comments addressed. |
@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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test case?
added
3bde19a
to
8980637
Compare
@@ -70,8 +70,15 @@ func NewResourceQuota(client clientset.Interface, registry quota.Registry, numEv | |||
}, nil | |||
} | |||
|
|||
var runningTotal time.Duration |
There was a problem hiding this comment.
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...
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. |
LGTM, thanks! |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 02c0181. |
Automatic merge from submit-queue |
Eliminates quota admission conflicts due to latent caches on the same API server.
@derekwaynecarr