fix(storage): canonicalize redb pool paths in core and graph - #1066
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Fixes #932 in both
ruvector-coreandruvector-graph. The redb pools now canonicalize the existing parent directory before they key or open a database file. This makessub/../shared.dband a symlinked directory resolve to the same pool slot as the direct path, while still allowing a database file that has not been created yet.The existing traversal check remains on the user-supplied path and runs before canonicalization. Both crates have regressions for relative parent traversal as well as the two alias cases.
Reproduction
Before the fix, the new
different_spellings_of_one_database_share_the_pooltest failed in each crate when the second live handle opened the same file throughsub/..:DatabaseError("Database already open. Cannot acquire lock.")Database already open. Cannot acquire lock.Validation
cargo test -p ruvector-core --no-default-features --features storage --lib storage::tests— 10 passedcargo test -p ruvector-graph --no-default-features --features storage --lib storage::tests— 10 passedcargo build -p ruvector-core -p ruvector-graph --no-default-features --features storage— passedcargo fmt --all --check— passedThe storage tests cover shared writes, symlink aliases (Unix), existing pool lifecycle races, and traversal rejection. Full workspace CI is pending.