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

Autoscaler considers reserved and pending replicas #7027

Merged
merged 7 commits into from
Aug 31, 2023

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Jun 19, 2023

Fixes #6733

  • Make autoscaler leader aware
  • Add grace period for scaling down

Signed-off-by: Pierangelo Di Pilato pierdipi@redhat.com

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 19, 2023
@knative-prow knative-prow bot requested review from lberk and matzew June 19, 2023 11:41
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 19, 2023
@codecov
Copy link

codecov bot commented Jun 19, 2023

Codecov Report

Patch coverage: 51.12% and project coverage change: -0.24% ⚠️

Comparison is base (dd68bd3) 77.89% compared to head (c85b9ad) 77.65%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7027      +/-   ##
==========================================
- Coverage   77.89%   77.65%   -0.24%     
==========================================
  Files         246      246              
  Lines       13214    13301      +87     
==========================================
+ Hits        10293    10329      +36     
- Misses       2400     2450      +50     
- Partials      521      522       +1     
Files Changed Coverage Δ
pkg/scheduler/statefulset/scheduler.go 72.43% <10.81%> (-4.84%) ⬇️
pkg/scheduler/state/state.go 82.31% <65.71%> (-2.22%) ⬇️
pkg/scheduler/statefulset/autoscaler.go 76.99% <67.21%> (-0.66%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi pierDipi changed the title [WIP] Autoscaler considers reserved and pending replicas Autoscaler considers reserved and pending replicas Aug 31, 2023
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 31, 2023
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Comment on lines +102 to +105
Pending map[types.NamespacedName]int32

// ExpectedVReplicaByVPod is the expected virtual replicas for each vpod key
ExpectedVReplicaByVPod map[types.NamespacedName]int32
Copy link
Member

Choose a reason for hiding this comment

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

the naming is a bit inconsistent, but we can fix that afterwards (e.g. PendingVReplica...)

Copy link
Member

@matzew matzew 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 knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2023
@knative-prow
Copy link

knative-prow bot commented Aug 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, pierDipi

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 knative-prow bot merged commit 10e25b9 into knative:main Aug 31, 2023
36 of 39 checks passed
pierDipi added a commit to pierDipi/eventing that referenced this pull request Aug 31, 2023
* Autoscaler considers reserved and pending replicas

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Format / lint fix

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Simplify MAXFILLUP logic to get the expected replicas

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Fix state tests

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Log scheduling state

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add grace period to scale down attempts

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Format Go code

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@pierDipi
Copy link
Member Author

/cherry-pick release-1.11

@pierDipi
Copy link
Member Author

/cherry-pick release-1.10

@knative-prow-robot
Copy link
Contributor

@pierDipi: new pull request created: #7216

In response to this:

/cherry-pick release-1.11

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.

@knative-prow-robot
Copy link
Contributor

@pierDipi: #7027 failed to apply on top of branch "release-1.10":

Applying: Autoscaler considers reserved and pending replicas
Applying: Format / lint fix
Applying: Simplify MAXFILLUP logic to get the expected replicas
Using index info to reconstruct a base tree...
M	pkg/scheduler/statefulset/autoscaler.go
M	pkg/scheduler/statefulset/scheduler.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/scheduler/statefulset/scheduler.go
CONFLICT (content): Merge conflict in pkg/scheduler/statefulset/scheduler.go
Auto-merging pkg/scheduler/statefulset/autoscaler.go
CONFLICT (content): Merge conflict in pkg/scheduler/statefulset/autoscaler.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Simplify MAXFILLUP logic to get the expected replicas
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.10

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.

openshift-merge-robot pushed a commit to openshift-knative/eventing that referenced this pull request Aug 31, 2023
* Autoscaler considers reserved and pending replicas



* Format / lint fix



* Simplify MAXFILLUP logic to get the expected replicas



* Fix state tests



* Log scheduling state



* Add grace period to scale down attempts



* Format Go code



---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/knative-eventing that referenced this pull request Aug 31, 2023
* Autoscaler considers reserved and pending replicas

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Format / lint fix

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Simplify MAXFILLUP logic to get the expected replicas

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Fix state tests

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Log scheduling state

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Add grace period to scale down attempts

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

* Format Go code

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-merge-robot pushed a commit to openshift-knative/eventing that referenced this pull request Sep 1, 2023
* Autoscaler considers reserved and pending replicas



* Format / lint fix



* Simplify MAXFILLUP logic to get the expected replicas



* Fix state tests



* Log scheduling state



* Add grace period to scale down attempts



* Format Go code



---------

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scheduler autoscaler is not considering reserved replicas
3 participants