Repository navigation
feat(clone): reap the internal snapshot a clone took on its source - #200
Draft
Andrei Kvapil (kvaps) wants to merge 1 commit into
Draft
Andrei Kvapil (kvaps) wants to merge 1 commit into
Andrei Kvapil (kvaps) wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Andrei Kvapil (kvaps)
force-pushed
the
fix/csi-clone-and-restore-idempotency
branch
from
October 8, 2026 03:38
47acc58 to
a4f876d
Compare
Andrei Kvapil (kvaps)
force-pushed
the
feat/clone-snapshot-reap
branch
2 times, most recently
from
October 8, 2026 08:43
3275ac7 to
f63a9f2
Compare
Andrei Kvapil (kvaps)
force-pushed
the
fix/csi-clone-and-restore-idempotency
branch
2 times, most recently
from
October 8, 2026 12:28
4ab3ffd to
5b23086
Compare
Andrei Kvapil (kvaps)
force-pushed
the
feat/clone-snapshot-reap
branch
from
October 8, 2026 12:28
f63a9f2 to
6005d23
Compare
Andrei Kvapil (kvaps)
force-pushed
the
fix/csi-clone-and-restore-idempotency
branch
from
October 8, 2026 17:58
5b23086 to
597e7c8
Compare
Andrei Kvapil (kvaps)
force-pushed
the
feat/clone-snapshot-reap
branch
from
October 8, 2026 17:58
6005d23 to
fd6a0e6
Compare
Andrei Kvapil (kvaps)
force-pushed
the
fix/csi-clone-and-restore-idempotency
branch
from
October 8, 2026 20:15
597e7c8 to
3e5eede
Compare
Andrei Kvapil (kvaps)
force-pushed
the
feat/clone-snapshot-reap
branch
from
October 8, 2026 20:15
fd6a0e6 to
fc78338
Compare
Andrei Kvapil (kvaps)
force-pushed
the
fix/csi-clone-and-restore-idempotency
branch
from
October 9, 2026 16:54
3e5eede to
d77d76c
Compare
Andrei Kvapil (kvaps)
force-pushed
the
feat/clone-snapshot-reap
branch
from
October 9, 2026 16:55
fc78338 to
605a101
Compare
A clone of a source with volumes takes `clone-<target>` on the source and restores from it, and nothing ever deleted that snapshot. Deleting the clone left it behind, and the source could then never be deleted again through the API, which refuses a definition that has snapshots. Every CSI clone goes through this path. `rd d` of a clone now reaps that snapshot, on both the REST and the CLI door. Ownership is a prop the clone path stamps on the snapshot, never its name, so an operator's snapshot called `clone-<target>` is never touched. The snapshot is visible in `s l`, so another definition can have been restored from it, and that definition keeps reading it: new replicas are pinned to its nodes and restored from it by name. A dependent appears in two steps, the snapshot read and the definition create, so no list on the reap's side alone can see one between them. The reap marks the snapshot, then lists dependents past the cache, and only then deletes; a restore creates its definition, then reads the snapshot back past the cache and withdraws on a live mark, on a snapshot whose delete is in flight, or on one that is gone. Whichever of the list and the create comes second sees the other. A snapshot the reap keeps has the mark taken off again. The reap runs detached from its caller on a bounded budget, since the delete has already been reported, and a mark left by a process that died expires. A delete that was issued is read off the snapshot itself: the store now surfaces DELETE on a snapshot a finalizer still holds, the way it does for resources, and the snapshot list no longer stamps SUCCESSFUL beside it. A later `rd d` of the source names what is still there: a snapshot safe to delete, one kept because a named definition restores from it, and one that looks like a clone's but was never stamped. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Andrei Kvapil (kvaps)
force-pushed
the
fix/csi-clone-and-restore-idempotency
branch
from
October 9, 2026 19:50
d77d76c to
7a940cd
Compare
Andrei Kvapil (kvaps)
force-pushed
the
feat/clone-snapshot-reap
branch
from
October 9, 2026 19:50
605a101 to
494a3e5
Compare
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.
Stacked on #190.
A clone of a source with volumes takes
clone-<target>on the source, and nothing ever deleted it, so once a clone existed the source could never be deleted through the API, which refuses a definition that has snapshots.rd dof a clone now reaps that snapshot, on both the REST and the CLI door.Ownership is a prop the clone path stamps, never the name, so an operator's snapshot called
clone-<target>is never touched. A snapshot another definition was restored from is kept. The reap marks the snapshot, lists dependents past the cache, and only then deletes; a restore reads its snapshot back past the cache once its definition exists and withdraws on a live mark, on a delete in flight, or on a snapshot that is gone. Whichever of the list and the create comes second sees the other. The store now surfaces DELETE on a snapshot a satellite finalizer still holds, and the snapshot list no longer stamps SUCCESSFUL beside it. A laterrd dof the source names what is left and why.