1 control plane allocation and zone transfer routing
forgejo-actions edited this page 2026-07-11 12:38:13 +00:00

Control-Plane Allocation And Zone Transfer Routing

Control-plane allocation chooses a live game instance for initial login or zone transfer. It filters stale records, evaluates admission snapshots, checks endpoints, resolves zone scene targets, and sorts healthy candidates before returning an assignment.

Purpose

Use this page when login falls back to a default game instance, transfer allocation returns 400 or 503, or the control plane routes players to a surprising instance.

Allocation Inputs

Initial game allocation uses service registry records, requested realm/region/zone, instance drain state, active and max players, endpoint set, zone allocations, and latest placement incarnation.

Zone-transfer allocation also uses target scene id, target zone, entry point, and zone scene lookup loaded from assets.

Admission Snapshot Rules

The control plane builds an AdmissionSnapshot for each candidate from the registered instance payload. Candidates with draining state, full capacity, unavailable endpoint, overloaded zone, full zone, or unavailable zone are filtered or deprioritized through shared admission semantics.

The control plane does not reserve capacity; the target game server still performs local admission during handshake.

Latest Placement Incarnation

Multiple records can exist for the same placement after restarts. Allocation keeps the latest incarnation per placement so stale records do not win just because they still have registry set membership.

If allocation chooses an old instance, inspect registry TTLs and incarnation values.

Priority Order

Candidate sorting prefers region match, endpoint health, healthier zone pressure, available zone capacity, global available capacity, and stable tie-breakers. Healthy beats degraded, degraded beats unknown, and unhealthy should not be allocatable.

This means the emptiest instance does not always win if its endpoint or zone pressure is worse.

Zone Transfer Scene Resolution

Transfer requests must use a canonical scene path. scene_lookup verifies that the target scene is hosted by the candidate zone and resolves the entry point. A non-canonical scene id maps to 400 Bad Request; no healthy host maps to 503 Service Unavailable.

Endpoint Health Requirements

Allocation requires a bootstrap endpoint and gameplay endpoint that are not unhealthy. Endpoint health is registered by the game server. If the game server marks QUIC unhealthy, allocation should avoid it even if HTTP health still works.

Fallback Behavior

Login has a default game-instance fallback for development scenarios. The fallback knows stable placement, but not the live incarnation. Treat fallback as a degraded path; fix control-plane registration when running multi-instance or production-like flows.

Debugging 400 Versus 503

400 usually means the request is malformed, often a non-canonical transfer scene. 503 usually means no eligible instance exists. Inspect registry records, zone allocation pressure, endpoint health, drain state, and game-server registration refresh.