Skip to content

Scaling logic not triggering on startup when current replicas are outside min/max range #3

Description

@bpretto

Issue

The AlloyDB autoscaler is not triggering any scaling actions when the current replica count is outside the specified min and max replicas range during startup.

Steps to Reproduce:

  1. Set the minimum replicas to 6 and the maximum replicas to 7 in the autoscaler configuration.
  2. Ensure that the AlloyDB instance in GCP has 5 replicas.
  3. Upon application startup, the autoscaler does not initiate any scaling action, despite the current replicas (5) being outside the defined range (6-7).

Log Output:

{"timestamp":"2025-08-19T11:45:51","level":"info","component":"scaling","action":"evaluate","instance":"totvs-sign-read","currentReplicas":5,"minReplicas":6,"maxReplicas":7,"message":"AlloyDB resources within normal thresholds"}  
{"timestamp":"2025-08-19T11:45:51","level":"info","component":"scaling","action":"decision","evaluationPeriod":"181.40s","scaleUpVotes":0,"scaleDownVotes":0,"message":"Making scaling decision"}  
{"timestamp":"2025-08-19T11:45:51","level":"info","component":"scaling","action":"maintain","message":"No scaling action needed, maintaining current replica count"}

Expected Behavior:

The autoscaler should act during the initialization process, ensuring that the currentReplicas are within the configured minReplicas and maxReplicas range. If the currentReplicas are outside this range (e.g., 5 replicas when the minimum is set to 6), the autoscaler should scale up the replicas accordingly.

Current Behavior:

The scaling decision logs show no action being taken, and the replicas remain unchanged despite the discrepancy between the current replica count and the defined replica range.

Additional Information:

This issue prevents the autoscaler from performing its intended function when the application is started, leaving the system with an incorrect number of replicas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions