Skip to content

fix: bind snapshot tag caches to immutable creation IDs - #444

Open
Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/snapshot-tag-generation
Open

Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/snapshot-tag-generation

Conversation

@Floating-Y

Copy link
Copy Markdown
Collaborator

Deleting and recreating a snapshot tag can leave another node restoring the previous image from its name-only cache, even when the master selects the correct new source. Keep the public tag-name API and bind each creation to an immutable snapshot ID instead.

  • Persist a fresh ID for each branch and carry it through local restores, transfer credentials, download deduplication, cache paths, reports, and cleanup commands.
  • Publish complete downloads and identity markers without replacing existing destinations; verify any destination already present. Restore opens the verified version directory.
  • Isolate late transfers and cleanup from newer versions, and fail rather than fall back to an old cache.
  • Assign stable IDs to pre-upgrade records, migrate authoritative source images, and re-fetch unversioned remote caches.
  • Reject a concurrent branch completion that would overwrite an already registered tag.

Regression coverage

No KVM required. Reuse the master HTTP and node TLS transfer tests, with a fake backend that reads the image opened by the real Runtime::create -> Backend::restore path.

Covers A-to-C source replacement, same-source recreation, late old transfers, delayed cleanup, occupied publication destinations, failed new transfers, legacy migration, and a second fork with no additional downloads. Both name-reuse regressions failed before the fix on old != new after source selection passed. The concurrent-branch test also failed before its guard (201 instead of 409).

Validation

  • cargo test -p sandstorm-core --quiet -- --test-threads=2: 423 passed.
  • cargo clippy -p sandstorm-core --all-targets --all-features -- -D warnings: passed.
  • cargo fmt --all -- --check and git diff --check: passed.

An initial parallel full-suite run hit the unchanged gateway startup timing assertion (620 ms versus a 600 ms limit); it passed individually and in the full rerun. No KVM or physical multi-node test was run. Upgrade the master and participating nodes together; old node binaries retain the original behavior.

Based on upstream dev at d27ab7c452126e3b34987b84d3c72cb41fc3fd16.

This branch has not been deployed

No deployments
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