import_ovpack(on_conflict="overwrite") deletes the existing resource before writing, so a failed import loses both versions
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 20/100
Research direction
Read openviking/storage/ovpack/operations.py, especially _remove_existing_root() and the import_ovpack() member-writing loop. PR #7421 describes the proposed backup and restore behavior, and the issue says two regression tests fail on main; inspect those tests and verify that a failed member write preserves the old resource. The issue already has an open pull request.
Written by the indexing model from the issue text.
Description
import_ovpack(..., on_conflict="overwrite") deletes the existing root before writing the package
Bug Description
import_ovpack() (openviking/storage/ovpack/operations.py:263) handles overwrite by calling _remove_existing_root() (operations.py:127) for every existing root and only then iterating the package members with mkdir / write_file_bytes (operations.py:343-368). The delete is not reversible and the member loop is not transactional.
Any failure during the member loop — a storage timeout, a full disk, an ACL error, process cancellation — leaves the destination with the new files partially written and the previous resource permanently deleted. The function raises, but neither the old nor the new version is intact.
Steps to Reproduce
- Import a pack at
viking://resources/demo, producinga.txtandb.txt. - Import a second pack for the same root with
on_conflict="overwrite". - Make
write_file_bytesfail for one member (e.g.b.txt) mid-import.
Expected Behavior
The failed import leaves the previous resource at viking://resources/demo intact, so the caller can retry.
Actual Behavior
The previous root was deleted before the member writes; the destination holds a partially written new root, and the previous a.txt / b.txt are gone.
Environment
- OS: Windows 11
- OpenViking version/commit: main @
95d96162
Additional Context
Fix submitted as PR #7421: the existing root is moved to <root>.ovpack-backup-<uuid> before writing, restored if the member loop fails, and discarded after a successful write. Filesystems without mv keep the previous delete-then-write behavior. Two regression tests fail on unmodified main.
- Dominant language
- Python
- Stars
- 41.8k
- Forks
- 3.4k
- Avg merge
- 19h 29m
- Merged PRs (30d)
- 500
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from volcengine/OpenViking
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
volcengine/OpenViking#7485 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
volcengine/OpenViking#7210 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
volcengine/OpenViking#7205 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failurePossibly taken @97Three claimed this 8 days ago. Openbug kernel
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
volcengine/OpenViking#7014 ·
Maintainers usually reply within 1 day
-
[Bug]: memory.prefetch_search_topn is inert above 5 (call site omits limit), plus two docstrings state the wrong defaultsPossibly taken @peterzhang987723 claimed this 8 days ago. Openkernel
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
volcengine/OpenViking#6923 · 2 comments ·
Maintainers usually reply within 1 day
All issues in volcengine/OpenViking
Similar issues
-
namespace
Difficulty 1/5 Under an hour Newbie friendliness 68/100
EclipseFdn/open-vsx.org#15604 ·
Maintainers usually reply within 1 day
-
app: scripts severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
netbox-community/netbox-scripts#164 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 5 days
-
Public function to read participants.tsvPossibly taken @bruAristimunha claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
huggingface/tau#799 ·
Maintainers usually reply within 2 days