neondatabase / autoscaling

Postgres vertical autoscaling in k8s
Apache License 2.0
153 stars 21 forks source link

plugin: Fix Score reserving when over-budget #987

Closed sharnoff closed 3 months ago

sharnoff commented 3 months ago

For calls to (*AutoscaleEnforcer).speculativeReserve(), the callback given to it returns a boolean which should indicate whether to actually reserve the Pod.

When handling Score, we were returning true (which we should never do in Score) exactly when the placement would have been over-budget. This meant that pods would be recorded on an over-full node early in the scheduling flow, disagreeing with the core scheduler, which causes even more calls to Score that we'd think are over-budget, exacerbating the problem.

ref https://neondb.slack.com/archives/C0798QG4D0T/p1719016313787749?thread_ts=1719014348.041469