Skip to content

coordinator: a resume reserves the session's recorded budget - #1789

Merged
nikhilunni merged 1 commit into
mainfrom
fix/resume-reserves-recorded-budget
Nov 11, 2026
Merged

nikhilunni merged 1 commit into
mainfrom
fix/resume-reserves-recorded-budget

Conversation

@nikhilunni

Copy link
Copy Markdown
Contributor

Problem

A message to an idle session waited in queued for about three minutes, until the fleet added a host. A host with enough room for the session was ready the whole time.

Two parts of the coordinator disagreed on the session's budget:

  • The resume fit check, the queued-resume check and the move admission took the budget from the image's current config.
  • The session row keeps the budget of the create. The host reservation sums, the queue and the park rule read the row.

After an image's memory config grows, every older session of that image has a row budget below the image budget. The resume fit check then finds no host with the larger figure. The park rule reads the smaller figure, sees that the queued session fits a host, and releases no park. Nothing changes until the fleet scales up. A move of such a session is refused as no_fit for the same reason.

Change

resolve_resume_budget reads the session's recorded budget through the new MetadataStore::session_budget. The image config decides only for a session that records no budget. A snapshot restores the VM at the size it was created with, so the recorded figure is the correct reservation, and the fit check now reads the same figure as the accounting.

Not in this change

The disk-only recovery path boots a new VM from the image's current config and also calls resolve_resume_budget. Its row budget did not follow the new VM size before this change, and does not now. That path needs the row updated when it boots; it is a separate fix.

Rollout

Coordinator only. No schema change: the method reads existing columns.

Tests

  • the_resume_budget_is_the_sessions_recorded_budget
  • Conformance scenario session_budget_is_the_create_time_reservation, on the simulator and on Postgres.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HNhpmz4QPYaVCE7tFna54D

A resume, a queued resume and a move took their budget from the image's
current config. The session row keeps the budget of the create, and the
host accounting, the queue and the park rule all read the row. After an
image config change the two figures differ for every older session.

With a larger image budget, the resume fit check found no host while the
park rule saw the queued session fit one, so no park yielded. The
session stayed queued until the fleet added a host. A move of such a
session was refused as no_fit for the same reason.

resolve_resume_budget now reads the recorded budget through the new
MetadataStore::session_budget. The image config decides only for a
session with no recorded budget. A snapshot restores the VM at its
original size, so the recorded figure is also the correct one.

Tests: the_resume_budget_is_the_sessions_recorded_budget; conformance
scenario session_budget_is_the_create_time_reservation on the simulator
and Postgres.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HNhpmz4QPYaVCE7tFna54D
@nikhilunni
nikhilunni merged commit 6173765 into main Nov 11, 2026
28 checks passed
@nikhilunni
nikhilunni deleted the fix/resume-reserves-recorded-budget branch November 11, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant