← Back to Pull requests

docs: correct Distributed fleet scale-down order from random to oldest-first #4873

Closed
unknown closed this pull request without merging on Nov 28, 2026 03:03 UTC
View on GitHub
unknown unknown commented on Nov 26, 2026 07:38 UTC
Author

What type of PR is this?
/kind documentation

What this PR does / Why we need it:
In #4862 it was agreed that this is a docs bug, since the order has been oldest first since 0.9.0 (2019).
With the Distributed scheduling strategy, a Fleet scale down removes the oldest Ready GameServers first: sortGameServersByDistributedStrategy sorts by creation timestamp in ascending order, and TestSortGameServersByDistributedStrategy expects that order. The docs say the GameServers are removed at random, and the code comments say newest first.

This PR updates the docs and the comments to match the code:

  • site/content/en/docs/Advanced/scheduling-and-autoscaling.md: the "Fleet Scale Down Strategy" section now says oldest first. The Counter and List priorities paragraph now says the creation timestamp tie-breaker is oldest first, and "instead of random removal" is removed.

  • pkg/gameserversets/gameserversets.go: the comments on SortGameServersByStrategy and sortGameServersByDistributedStrategy.
  • No behaviour change.

    Which issue(s) this PR fixes:
    Closes #4862

    Did you use AI tools in preparing this PR?:
    Y. This PR was written in part with the assistance of generative AI. I reviewed the change, ran make -C build lint test-go, and checked the order on a kind cluster (see #4862).

    Special notes for your reviewer:
    The docs also say that the order between GameServers created within the same second is not defined, because creation timestamps have a resolution of one second.

    Diff: 199 lines (+149 / -50) across 2 files Reviewer: markmandel Review duration: 2605m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 199 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.317
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4873"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.1% (MEDIUM) · Higher = larger blast radius
    36.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.3% · Safe to merge
    14.3%