Skip to content

fix(ovpack): restore protected scope roots - #3889

Open
Oldrich333 wants to merge 1 commit into
volcengine:mainfrom
Oldrich333:fix/ovpack-protected-root-restore
Open

fix(ovpack): restore protected scope roots#3889
Oldrich333 wants to merge 1 commit into
volcengine:mainfrom
Oldrich333:fix/ovpack-protected-root-restore

Conversation

@Oldrich333

Copy link
Copy Markdown

Summary

Fixes the full-backup overwrite restore path for initialized servers by treating protected namespace roots as structural containers:

  • clear children of viking://user / viking://agent instead of deleting the protected root;
  • skip replaying the synthetic protected-root directory entry itself;
  • retain normal replacement behavior for unprotected roots such as viking://resources.

Closes #3875.

This supersedes the approach in the closed #3876: clearing children alone still leaves restore failing when archive extraction calls mkdir("viking://user") (PERMISSION_DENIED). This change covers both phases.

Type of Change

  • Bug fix

Testing

  • ruff check passes for changed files.
  • ruff format --check passes for changed files.
  • All 19 tests in tests/misc/test_ovpack_import_policy.py pass.
  • Added regression coverage for an initialized target with existing resources and protected user roots.
  • End-to-end validated with the v0.4.13 Docker image: created an isolated encrypted server and account, uploaded a real restore-only OVPack through /api/v1/resources/temp_upload, restored through /api/v1/pack/restore with on_conflict=overwrite, and read the restored resource tree. The isolated container and data were removed afterward.

Safety properties

  • The OVPack manifest, members, hashes, and vector payload are fully validated before any existing root is mutated (existing restore ordering is preserved).
  • Invalid child records abort rather than deleting an unverified URI.
  • A child deletion error propagates; restore never reports success with known stale content.

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Bug]: ov restore --on-conflict overwrite fails because viking://user cannot be deleted

1 participant