fix: Fix flapping with list-based FleetAutoscaler#4625
Conversation
d6a0d4d to
54051dd
Compare
|
/gcbrun Let's run it! |
|
Build Succeeded 🥳 Build Id: dba2d045-e0fb-411c-80bf-d65f08fb8fde The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
7689469 to
f4f142d
Compare
|
/gcbrun |
|
Build Failed 😭 Build Id: 25f74ba2-9d6d-4ce8-8b13-722ed7a854e3 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
It passed yesterday and all that's changed since is a rebase and a comment 😭 |
|
/gcbrun That's a new flake - haven't seen that before. Let's run it again, while I run this in the background. |
|
Build Succeeded 🥳 Build Id: 4e13082e-de99-44a5-ab21-40bf3e84d636 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
markmandel
left a comment
There was a problem hiding this comment.
Found a couple of small things - but otherwise, LGTM.
Signed-off-by: Rhys Perry <[email protected]>
…ules Signed-off-by: Rhys Perry <[email protected]>
ca6e052 to
5cbf6d1
Compare
|
Reworked the tests to be a bit more data-driven (with some test cases that also hit the limited paths). Also covers asserting the limited response. Thanks Mark and Thomas for the pointers :D |
|
/gcbrun |
|
Build Failed 😭 Build Id: 1fc4aa37-0b38-445a-a757-60505f6aa9f2 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Succeeded 🥳 Build Id: 51d5bc32-aa28-4464-afbe-8f6c998ebd63 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Yippee! |
What type of PR is this?
/kind bug
What this PR does / Why we need it:
There is an issue caused by inconsistencies in FleetAutoscaler upscale logic and downscale logic, resulting in flapping when using a List based policy. This was reported here on Slack.
The root cause of the problem is due to the way that downscale decisions are made. The downscale logic:
The first two steps were implemented in a way that does not match how Fleets will actually choose to delete a server, as it doesn't exclude GameServers that would normally be considered undeletable. This inconsistency between the simulated deletion and actual deletion logic is what leads to constant upscaling and downscaling (flapping).
The first commit on this PR implements a test to reproduce the issue described, and to help check for regressions in the future.
The second commit on the PR implements the logic in FleetAutoscaler to correctly check which servers would be deleted on a downscale.
Which issue(s) this PR fixes:
Addresses the issue raised on Slack here.
Did you use AI tools in preparing this PR?:
No
Special notes for your reviewer:
A build of this code was tested by the user that originally reported the issue on Slack. They are able to confirm that it fixes the original issue.