Revisions should wait for minScale replicas to report ready#3493
Revisions should wait for minScale replicas to report ready#3493knative-prow-robot merged 6 commits intoknative:masterfrom
Conversation
knative-prow-robot
left a comment
There was a problem hiding this comment.
@pivotal-joshua-rider: 0 warnings.
Details
In response to this:
Fixes #3077
Proposed Changes
- Revisions with a minScale annotation are marked Ready when they have at least
minScalenumber of ready replicas- Revisions with a minScale annotation that are marked as Ready are marked as "Deploying" when they have fewer than
minScaleready replicas.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
|
/assign @grantr |
|
/ok-to-test |
|
@pivotal-joshua-rider: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
/unassign |
| return ms > 0 | ||
| } | ||
|
|
||
| func getMinScale(rev *v1alpha1.Revision) (int, error) { |
There was a problem hiding this comment.
This is not an error. Just return 0.
| } | ||
|
|
||
| func hasMinimumEndpoints(e *corev1.Endpoints, minimum int) bool { | ||
| count := 0 |
There was a problem hiding this comment.
To be in the vein with the following method
for es in range:
min -= len(es.Adds)
if min <= 0:
return True
return False
|
/assign tl;dr I generally don't like this approach. The I think that I'd like to see a way for the PodAutoscaler to gate Revision readiness, which we don't today. One way would be to have the PodAutoscaler take over handing this aspect of readiness and surfacing it here. |
This makes a lot of sense. I'll dig in a bit further and come back with some questions. 👍 |
|
Thanks @pivotal-joshua-rider ! |
|
@joshrider Any news on this PR? |
|
@markusthoemmes I should be able to get something up shortly! |
43461e8 to
905c47c
Compare
|
/retest |
|
@markusthoemmes @mattmoor Feedback is appreciated! Things generally go as expected, but I have occasionally noticed a lag between the last needed Replica becoming ready and the KPA becoming ready. There is also lots of room for cleanup in the scaler, but I figure that's the job of a different PR.
|
vagababov
left a comment
There was a problem hiding this comment.
A few more test related items. :-)
But
/lgtm
|
The following is the coverage report on pkg/.
|
|
Currently, the system brings 1 Pod to 'ready' before it can start scaling up to the minimum. Should we be scaling to the minimum from the start? |
|
This pr will make the code start much longer, cause it will need to wait to proxy request from activator to user pod until the minscale pod turn ready. I really don’t want to sacrifice this. |
In fact, |
|
That all makes sense. What are the cases where the activator would be waiting with requests? Given that minScale keeps some number of pods warm, would it just be during the initial launch? Are we also worried about cases where a configuration is updated and we take longer getting the new revision up? |
Yeah, you are right, this would only happen in the initial launch of a revision, then it would be fewer worry for me, but I think it still need superpower to consider this. @markusthoemmes WDYT |
|
By the very design of this, it will take longer to even get to Ready. As you already mentioned, the activator isn't a concern in this case, as minScale prevents the activator from being hooked in in the first place. The activator will not be hooked in during initial launch either, we don't do that currently. |
|
mattmoor
left a comment
There was a problem hiding this comment.
oops, a couple unsent comments...
| // Don't scale-to-zero during activation | ||
| desiredScale = scaleUnknown | ||
| if min, _ := pa.ScaleBounds(); min == 0 { | ||
| return scaleUnknown, false |
There was a problem hiding this comment.
why not desiredScale = scaleUnknown still?
There was a problem hiding this comment.
Note: I'm not asking about the condition, but the early return.
There was a problem hiding this comment.
It was put into place to accommodate the moved desiredScale < 0 guard in the caller in order to maintain the existing functionality of returning scaleUnknown and not "applying" the scale.
Happy to move the desiredScale < 0 check back and switch this over if it's preferred.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joshrider, mattmoor, vagababov The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mattmoor are we good to remove the hold on this? |
|
/hold cancel Yeah, sorry I didn't realize that was still there! thanks for the reminder. |
…3493) * revisions become ready with minScale reached * remove redundant condition * revert accidental spacing changes * cleanup test helpers * cleanup tests * remove copypasted comment
…3493) * revisions become ready with minScale reached * remove redundant condition * revert accidental spacing changes * cleanup test helpers * cleanup tests * remove copypasted comment
Fixes #3077
Proposed Changes
minScalenumber of ready replicasaddEndpointhelper