Repository navigation
coordinator: a resume reserves the session's recorded budget - #1789
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A message to an idle session waited in
queuedfor 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:
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_fitfor the same reason.Change
resolve_resume_budgetreads the session's recorded budget through the newMetadataStore::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_budgetsession_budget_is_the_create_time_reservation, on the simulator and on Postgres.🤖 Generated with Claude Code
https://claude.ai/code/session_01HNhpmz4QPYaVCE7tFna54D