Repository navigation
fork into a new name starts unfenced (same-name fork keeps the stamp) - #136
Merged
Merged
Conversation
A fork copied its source's manifest, fence stamp included, so a child whose placement generation or lease was below the source's was refused (409) on a volume nobody else can hold. Clear generation and lease_revision when the source manifest name differs from the new name; keep them for a same-name reconstitute, where the volume has an owner. A test for each case. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WpMBiuyDqNxzR7KWb88RS3
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.
A fork copies its source's manifest, and with it the source's fence stamp (generation, lease_revision). The fork's own attach is then fenced against that stamp (api.rs enforce_attach_fence), so a child placed below its source's generation, or on a node whose lease revision is lower, got 409 on a volume nobody else can hold. This breaks create-from-snapshot, where the child is a new instance with its own placement.
create_export now clears both halves of the stamp when the source manifest name differs from the new name. The caller's token stamps it at attach. A fork into the same name (a parked volume reconstituted from its own manifest, as instd's purge does) keeps the stamp, so a lower token is still refused.
Tests: test_fork_into_a_new_name_starts_unfenced (a child at generation 1 forks a snapshot of a volume owned at (5,2): granted, owned at (1,1); a tokenless fork starts unstamped; the source keeps its own fence) and test_same_name_reconstitute_keeps_the_stamp (a lower token is refused, the owning one granted). The first fails on main (409) and passes here; block::api, router and fence tests: 137 pass.
No homelab deploy from this PR; the team lead schedules it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WpMBiuyDqNxzR7KWb88RS3