Skip to content

fork into a new name starts unfenced (same-name fork keeps the stamp) - #136

Merged
jaredLunde merged 1 commit into
mainfrom
glidefs-fork-unfenced
Nov 12, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
glidefs-fork-unfenced

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

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

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
@jaredLunde
jaredLunde merged commit 7ad8184 into main Nov 12, 2026
25 checks passed
@jaredLunde
jaredLunde deleted the glidefs-fork-unfenced branch November 12, 2026 05:48
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