Repository navigation
feat(scaling): a unit that goes leaves the mesh - #669
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALjNbLobvPe7VwvDL8j7V3
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.
Description
Before: when auto scaling let a unit go, or a launch failed, the machine's mesh node stayed on the Nodes page with a valid certificate and database user, and an unspent join token for it stayed usable for up to an hour. Docs listed "revoking a unit's mesh certificate when it goes" under Refine later.
After: a unit that goes (let go, failed, or never came up) leaves the mesh. Its unspent join token is withdrawn, and the node that joined with it is removed as on the Nodes page: its certificates go on the blocklist and its database user is removed. The ledger row for the terminate names the nodes taken off (
off_mesh).How:
mesh.let_go_unit(db, name)finds the join tokens scaling made under the unit's name, revokes the unspent ones and callsmesh.removefor each live, non-primary node that joined with one.scaling._terminateand the failed-launch path call it through_unmesh, which logs and carries on if the mesh module is off or errors.Motivation and Context
Adeel asked for auto scaling that "setups and manage every single thing". A machine let go shouldn't keep a way back into Lens.
Types of changes
!in the title)Checklist:
test_a_unit_let_go_or_failed_leaves_the_mesh,test_a_scaling_unit_let_go_leaves_the_mesh_with_its_tokenwith the real mesh and fake Nebula).docs/scaling.mdMachines elsewhere and Refine later,docs/requirements.md).changelog.d/scaling-unmesh.md.Done questions (AGENTS.md)
mesh.remove, the same path the Nodes page uses.Generated by Claude Code