Repository navigation
compensate for raft/cache delay in namespace admission - #10911
Conversation
|
[test] |
|
lgtm. This should hold on the rebase. The code in this admission plugin changes in 1.4 |
|
I expect we'll want a backport to 3.3.1 |
| // in case of latency in our caches, make a call direct to storage to verify that it truly exists or not | ||
| // as a last resort, make a call directly to storage | ||
| // this also benefits from the Sleep() above allowing for propagation in HA storage cases | ||
| namespaceObj, err = l.client.Core().Namespaces().Get(a.GetNamespace()) |
There was a problem hiding this comment.
I also would be fine skipping this, using a poller for X milliseconds on the cache, and skipping the "live" check altogether.
There was a problem hiding this comment.
Having just debugged a ton of namespace deletion flakes, I am cautious about doing two changes like this at once even though I know that is not rational.
There was a problem hiding this comment.
to clarify, i mean i want to wait 50ms AND keep continuing to do the live call. so suspenders with the belt.
|
and we want this for 1.3.0 or 1.3.1 |
No objection from me, but aren't those branches already split? |
imminently |
|
|
||
| if !exists { | ||
| // give the cache time to observe a recent namespace creation | ||
| time.Sleep(50 * time.Millisecond) |
There was a problem hiding this comment.
nit: put this in a big fat constant at top of file?
There was a problem hiding this comment.
this is also not just namespace creation. if a namespace is deleted, we purge it from the local store.
There was a problem hiding this comment.
moved to constant, and also limited this to create cases
|
Evaluated for origin test up to 14d24cb |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8930/) |
|
[merge] |
|
Evaluated for origin merge up to 14d24cb |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8930/) (Image: devenv-rhel7_5058) |
When attempting to create an object in a just-created namespace, the admission plugin can reject the creation attempt for two reasons:
This PR adds a delay, then rechecks the cache before proceeding with the live lookup. This gives both the cache and the backing storage more time to observe the create, before failing the request.
Fixes #10909