Repository navigation
fix: reclaim clone-source copies no pod on the node clones from - #120
Merged
Merged
Conversation
The reclaimer treated every unused vk- snapshot as a VM's hibernate copy and verified it against <name>:hibernate in the registry. A clone-source copy of a non-default tag or a digest carries a colon in its local name, so that lookup built an invalid reference, the error was not errStaleLocalSnapshot, and the copy was kept forever with no log line. #118 made every digest clone source land on this path; the kit's N28 run left two 1 GiB digest copies on the node. VM names never contain a colon, so a colon in the name marks a pulled clone-source copy: re-pullable, owned by no VM, and safe to drop once no pod on the node clones from it. Verify errors that are not staleness now log at Warn instead of vanishing.
CMGS
added a commit
that referenced
this pull request
Sep 29, 2026
The reclaimer only looked at vk- names, so a clone source pulled from another repository (simular/osworld-ref:ref12, or a default-tag simular/golden) stayed on the node forever once no pod used it. A name alone cannot tell such a copy from a snapshot an operator imported by hand, which may exist nowhere else. vk-cocoon now imports every clone-source pull with the description "vk-cocoon clone source" (cocoon's snapshot import already takes one and snapshot list reports it). The reclaimer removes a marked snapshot once no pod on the node clones from it, whatever its name; the registry still holds it. Unmarked snapshots outside the vk- names are never touched, and the #120 colon rule stays for vk- copies pulled before the mark existed. Hibernate wake imports stay unmarked. docs/reconcile.md now describes both rules.
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.
Bug
Found on hardware (kit run N28, case D6) after #118.
reclaimLocalSnapshotstreats every unusedvk--prefixed local snapshot as a VM's hibernate copy and checks it against<name>:hibernatein the registry. A clone-source copy pulled for a non-default tag or a digest has a colon in its local name (vk-…:v2,vk-…:sha256:…-hash), soGetManifestbuildsbase/vk-…:sha256:…-hash:hibernate, whichParseReferencerejects. That error is noterrStaleLocalSnapshot, so the copy is kept forever, silently. Default-tag copies (vk-…, no colon) happened to be reclaimed because their hibernate tag is absent. On the kit, two 1 GiB digest copies stayed on host B after every pod was gone and vk restarted.This predates #118 for any
repo:tagclone source; #118 put every digest clone on the same path.Fix
snapshotNamesInUsederives the same name from each tracked pod's image).keep local snapshot …) instead of being dropped.Tests
TestTheReclaimerDropsOnlyWhatNoPodOnTheNodeCanWakeFromgains four cases, each with a registry that cannot answer (so the reclaim cannot depend on it): an unused tagged copy and an unused digest copy are removed; a tagged and a digest copy that a tracked pod clones from are kept. Both removal cases fail on main (removed [], want [...]) and pass here; every existing case keeps its result.Gates
make lint0 issues on linux and darwin,make fmt-checkclean,asl ./...clean on both GOOS,go test -race ./...green (GOWORK=off). Hardware: the N28 D6 case is the acceptance; not rerun yet. Hot path: none, the reclaimer runs every 10 minutes.