Repository navigation
fix(storage): separate BufferStorage creation and write permissions - #870
Merged
Merged
Conversation
JalinWang
approved these changes
Nov 2, 2026
richyreachy
approved these changes
Nov 2, 2026
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.
Opening an existing buffer-backed index with
create_new=falsepreviously opened its pool as read-only, even whenread_only=false. AddIndexStorage::OpenOptionsand pass creation and access permissions separately fromIndex::open(), so an existing index can remain writable without permitting file creation.The legacy boolean entry point keeps its existing behavior. The explicit entry point is opt-in for storage implementations, rejects read-only creation requests, and preserves the read-only bypass-only fallback. Writable pools still require cache initialization. Storage-open errors now reach the caller unchanged, including
OpenFileandNoMemory.Related to the storage-open review discussion in #833. Once this lands, #833 can use the explicit options entry point in place of its boolean OR workaround.
Validation on macOS arm64 (Release, C++17, warnings treated as errors; optional RaBitQ implementation disabled):
buffer_storage_write_test: 60 tests passed, including writable reopen persistence, missing-file creation permissions, legacy access modes, read-only bypass fallback, and writable memory-pressure retry.index_interface_test: 7 selected tests passed, covering buffer-backed reopen persistence and error propagation, dirty-state tracking, IVF read-only loading, and DiskANN reads across cache budgets.hnsw_turbo_index_test: 18 selected reopen tests passed, including the legacy BufferStorage loading path.clang-format18.1.8 andgit diff --checkpassed.