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

Fix the problem where old PAs go into unknown state. #3836

Merged
merged 1 commit into from
Apr 20, 2019

Conversation

vagababov
Copy link
Contributor

Origianally (even before my changes) the old updatePAStatus
method would change the status of the PA to unknown, even if it's
inactive. The reason for that is that after restart for an inactive
revision the desired scale is always -1.
Now, this was not much of a problem in the previous life, since when
activated the desired scale would become 1 and everything would unfold
as desired. But in this new brave world, this causes SKS to reconcile to
serve more, which removes the activator endpoints from the public k8s
service and prohibits our future endeavours like positive handoff.

The change is simple: basically ignore want==-1 scale events, when
changing status. This works because:
if want == -1 and we're inactive => stay inactive
if want == -1 and we're active => stay active
if want == -1 and we're activating => continue activating.

/cc @mattmoor
#1997

Origianally (even before my changes) the old updatePAStatus
method would change the status of the PA to unknown, even if it's
inactive. The reason for that is that after restart for an inactive
revision the desired scale is always -1.
Now, this was not much of a problem in the previous life, since when
activated the desired scale would become 1 and everything would unfold
as desired. But in this new brave world, this causes SKS to reconcile to
serve more, which removes the activator endpoints from the public k8s
service and prohibits our future endeavours like positive handoff.

The change is simple: basically ignore want==-1 scale events, when
changing status. This works because:
if want == -1 and we're inactive => stay inactive
if want == -1 and we're active => stay active
if want == -1 and we're activating => continue activating.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 20, 2019
@knative-prow-robot knative-prow-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/autoscale labels Apr 20, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/autoscaling/kpa/kpa.go 86.8% 91.4% 4.6

@vagababov
Copy link
Contributor Author

/test pull-knative-serving-integration-tests

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 20, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mattmoor, vagababov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 888af3c into knative:master Apr 20, 2019
@vagababov vagababov deleted the 1997-fix--1-handling branch June 7, 2019 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/autoscale cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants