Repository navigation
feat: add open for read only map index - #9223
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change adds read-only lifecycle support for map indices. ReadOnlyAppendableMapIndex::open opens a Gridstore-backed index in read-only mode, returns Ok(None) if the directory is missing, rebuilds MutableMapIndexInner by iterating stored entries while tracking IO counters, and retains the GridstoreReader. ReadOnlyMapIndex gains open_appendable (delegates to the appendable opener), open_immutable (opens mmap-backed indices with effective on-disk logic), and get_mutability_type. Module docs and an integration test exercising appendable round-trip opening and queries were added. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@lib/segment/src/index/field_index/map_index/mutable_map_index/read_only/lifecycle.rs`:
- Around line 47-59: The code currently calls storage.iter::<_,
GridstoreError>(...) and then .unwrap(), which incorrectly assumes iteration
cannot return I/O errors; replace the unwrap with proper error
propagation/handling so GridstoreError is returned to the caller instead of
panicking. Concretely, have the surrounding function return a Result and
propagate the Result from storage.iter (use ? or map_err) so failures from
GridstoreReader::iter are surfaced; keep the existing callback that calls
inner.ingest and the hw_counter.ref_payload_index_io_write_counter() argument
unchanged, and ensure max_point_offset() semantics are preserved while changing
the call site to propagate the iteration error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: ddef0a9f-c1f0-4c15-8d75-697f094ff010
📒 Files selected for processing (9)
lib/gridstore/src/gridstore/mod.rslib/gridstore/src/gridstore/reader.rslib/gridstore/src/gridstore/tests.rslib/gridstore/src/pages.rslib/gridstore/src/tracker.rslib/segment/src/index/field_index/map_index/mutable_map_index/read_only/lifecycle.rslib/segment/src/index/field_index/map_index/mutable_map_index/read_only/mod.rslib/segment/src/index/field_index/map_index/read_only/lifecycle.rslib/segment/src/index/field_index/map_index/read_only/mod.rs
|
rebase on top of #9256 please |
40caf94 to
053b476
Compare
e0912f1 to
38549c9
Compare
…open Replace the path.exists() pre-check in the read-only appendable map index open path with error-driven detection through ok_not_found(). Generalize OkNotFound over an IsNotFound trait, implemented for io::Error, mmap::Error, UniversalIoError, and GridstoreError so a NotFound surfacing through any layer (including mmap's inner io::Error) maps to Ok(None). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
* feat: add open methods for map * fix: review comments * feat: detect not-found via error instead of path.exists in map index open Replace the path.exists() pre-check in the read-only appendable map index open path with error-driven detection through ok_not_found(). Generalize OkNotFound over an IsNotFound trait, implemented for io::Error, mmap::Error, UniversalIoError, and GridstoreError so a NotFound surfacing through any layer (including mmap's inner io::Error) maps to Ok(None). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * review: revert internal error conversion --------- Co-authored-by: generall <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
All Submissions:
devbranch (notmaster) and my branch was created fromdev.New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --workspace --all-featurescommand?Changes to Core Features: