fix(fc): re-anchor clone drives at their own paths after snapshot load#88
Merged
Conversation
FC's snapshot/load reopens the drive paths embedded in the vmstate, so clone satisfies them with temporary symlink redirects — but the loaded VMM's device config keeps naming the source's paths. Any later snapshot of the clone (vm hibernate, vm snapshot) embeds those dangling paths and its restore fails with ENOENT on the source COW. PATCH /drives after resume repoints each redirected drive at the clone's canonical path (same inode, so the guest sees nothing), making the clone's future snapshots self-contained.
The fix's invariant — every redirected drive gets re-anchored — lived in two textually-duplicated guards that could drift apart silently. redirectedDriveIndices is now the single source for both loops, and unit tests pin createDriveRedirects to it.
Contributor
Author
|
Review applied: the redirect and re-anchor loops now both derive from a single |
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.
Snapshots taken of an FC clone could not be restored:
snapshot/loadreopens the drive paths embedded in the vmstate, clone satisfies them with temporary symlink redirects, and the loaded VMM's device config keeps naming the source's paths. A latervm hibernate/snapshot saveof the clone embeds those dangling paths, and its restore dies withError manipulating the backing file: No such file or directoryon the source COW (the golden builder's run dir, long gone).Fix: after resume,
PATCH /drives/{id}repoints each redirected drive at the clone's canonical path — same inode through the redirect, so the guest observes nothing; every future snapshot of the clone now embeds paths that exist at restore time.Found by the sandbox control-plane e2e (its warm pool is golden clones; the new hibernate → transparent-wake smoke step failed exactly here), reproduced and verified on hardware: with this fix the full suite passes, including clone → hibernate (467ms end-to-end through the SDK relay, session state intact after wake).
make lint testgreen.