fix(storage): support file resources as relation sources (ENOTDIR) #3067#3089
Open
chethanuk wants to merge 3 commits into
Open
fix(storage): support file resources as relation sources (ENOTDIR) #3067#3089chethanuk wants to merge 3 commits into
chethanuk wants to merge 3 commits into
Conversation
volcengine#3067 - Add _relation_table_path helper + route _read/_write_relation_table - Register .relations as internal for ls/hide/webdav/ovpack - Unit tests for path logic covering file vs dir sources (plan §5 rows)
… source Drives the actual VikingFS.link / get_relation_table / unlink path for a file source through an in-memory backend that models localfs ENOTDIR (a file cannot hold children), so the test both reproduces the original bug and proves the sidecar routing fixes it. Also asserts the dir-source path stays byte-identical and .relations is registered internal. refs volcengine#3067
…tring The _write_relation_table parent-dir guard used `"/.relations/" in table_path`, which assumes source_path is rooted/absolute and would misfire for any dir whose own path contains a .relations segment. Compare table_path against the computed legacy dir-source form (<dir>/.relations.json) instead — correct regardless of whether the path is rooted, and behavior-identical for all real (rooted) inputs. refs volcengine#3067
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.
Description
File resources can now be sources for
ov link/ relations (previously ENOTDIR when source was a file). Directory sources unchanged (byte-identical on-disk format, zero migration).Related Issue
Fixes #3067
Type of Change
Changes Made
_relation_table_path(source_path, ctx)inviking_fs.pythat stats the source and returns<dir>/.relations.json(dirs) or<parent>/.relations/<name>/.relations.json(files)_read_relation_tableand_write_relation_table(and callerslink/unlink/get_relation_table) through the helper_write_relation_tablenow calls_ensure_parent_dirsfor sidecar paths.relationsinSTORAGE_INTERNAL_ENTRY_NAMES+WEBDAV_RESERVED_FILENAMES(internal_names.py) so sidecars are hidden from ls, not vectorized, not exported, not exposed over WebDAVTesting
New
tests/storage/test_relation_file_source.py(11 tests):VikingFS.link-> persist ->get_relation_tableread-back ->unlinkpath for a file source through an in-memory backend modeling localfsENOTDIR(a file cannot hold children) — it reproduces the original bug via a control assertion, then proves the sidecar routing makes the link succeed<dir>/.relations.json);.relationsasserted registered internal (hidden from ls + WebDAV)Existing relation/link, listing, ovpack, and ingest regression surfaces continue to key on the preserved
.relations.jsonbasename (no filter edits needed)Ruff clean
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
I have tested this on the following platforms:
Checklist