Repository navigation
Universal IO: gridstore pages - #8223
Conversation
generall
commented
Feb 24, 2026
- [manunal] Gridstore page use universal IO
- fmt
| fn len(&self) -> crate::universal_io::Result<u64> { | ||
| Ok(self.mmap.len() as u64) | ||
| } |
There was a problem hiding this comment.
Nit: Can we use super::Result and just do Result instead of crate::universal_io::Result in this file?
| let Some(ValuePointer { | ||
| page_id, | ||
| block_offset, | ||
| length, | ||
| } = self.get_pointer(point_offset)?; | ||
| }) = self.get_pointer(point_offset) | ||
| else { | ||
| return Ok(None); | ||
| }; |
There was a problem hiding this comment.
| let Some(ValuePointer { | |
| page_id, | |
| block_offset, | |
| length, | |
| } = self.get_pointer(point_offset)?; | |
| }) = self.get_pointer(point_offset) | |
| else { | |
| return Ok(None); | |
| }; | |
| let Some(pointer) = self.get_pointer(point_offset) else { | |
| return Ok(None); | |
| }; | |
| let ValuePointer { | |
| page_id, | |
| block_offset, | |
| length, | |
| } = pointer; |
| let Some(ValuePointer { | ||
| page_id, | ||
| block_offset, | ||
| length, | ||
| } = self.tracker.write().unset(point_offset)?; | ||
| let raw = self.read_from_pages::<false>(page_id, block_offset, length); | ||
| }) = self.tracker.write().unset(point_offset) | ||
| else { | ||
| return Ok(None); | ||
| }; |
There was a problem hiding this comment.
| let Some(ValuePointer { | |
| page_id, | |
| block_offset, | |
| length, | |
| } = self.tracker.write().unset(point_offset)?; | |
| let raw = self.read_from_pages::<false>(page_id, block_offset, length); | |
| }) = self.tracker.write().unset(point_offset) | |
| else { | |
| return Ok(None); | |
| }; | |
| let Some(pointer) = self.tracker.write().unset(point_offset) else { | |
| return Ok(None); | |
| }; | |
| let ValuePointer { | |
| page_id, | |
| block_offset, | |
| length, | |
| } = pointer; |
| mut callback: F, | ||
| hw_counter: HwMetricRefCounter, | ||
| ) -> std::result::Result<(), E> | ||
| ) -> std::result::Result<(), Either<E, GridstoreError>> |
There was a problem hiding this comment.
Would where E: From<GridstoreError> work here? This way we can get rid of Either, ? would work on GridstoreError.
There was a problem hiding this comment.
Unfortunatelly no, this error is propagated from crates and there are not guaranteed to be compatible with Gridstore error in any way
There was a problem hiding this comment.
I mean, it's callback, so we can require it to be compatible. Or the other way round, make it where GridstoreError: From<E> and then if you modify code that require new error subtype in GridstoreError, you just add it.
There was a problem hiding this comment.
where E: From<GridstoreError> works fine
UPD: Didn't notice you already implemented that in #8230 lol
* Apply review feedback from PR #8223 - Use `super::Result` import in mmap.rs instead of fully-qualified `crate::universal_io::Result` - Restructure ValuePointer destructuring in get_value and delete_value to first match Some(pointer), then destructure separately * Replace Either<E, GridstoreError> with E: From<GridstoreError> in Gridstore::iter Use a trait bound instead of Either to combine callback and gridstore errors, allowing `?` to work directly on GridstoreError. This simplifies callers by removing Either matching and io::Error conversion workarounds. --------- Co-authored-by: qdrant-claw <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThis pull request refactors the universal I/O abstraction and storage layer to use Result-based error handling throughout. Key changes include: converting MmapUniversal and UniversalRead/UniversalWrite trait methods from direct returns to Result types; making Page generic over a UniversalWrite implementation instead of concrete mmap usage; adding a len() method to UniversalRead; adding UniversalIoError variant to GridstoreError; updating Gridstore methods (read_from_pages, get_value, delete_value, write_into_pages, populate) to return Results and propagate errors; and propagating error handling through storage indices (mutable text index, geo index, map index, numeric index, mmap payload storage, sparse vector storage). Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
* [manunal] Gridstore page use universal IO * fmt * Apply review feedback for universal IO gridstore pages (#8230) * Apply review feedback from PR #8223 - Use `super::Result` import in mmap.rs instead of fully-qualified `crate::universal_io::Result` - Restructure ValuePointer destructuring in get_value and delete_value to first match Some(pointer), then destructure separately * Replace Either<E, GridstoreError> with E: From<GridstoreError> in Gridstore::iter Use a trait bound instead of Either to combine callback and gridstore errors, allowing `?` to work directly on GridstoreError. This simplifies callers by removing Either matching and io::Error conversion workarounds. --------- Co-authored-by: qdrant-claw <[email protected]> --------- Co-authored-by: qdrant-claw <[email protected]>
* [manunal] Gridstore page use universal IO * fmt * Apply review feedback for universal IO gridstore pages (#8230) * Apply review feedback from PR #8223 - Use `super::Result` import in mmap.rs instead of fully-qualified `crate::universal_io::Result` - Restructure ValuePointer destructuring in get_value and delete_value to first match Some(pointer), then destructure separately * Replace Either<E, GridstoreError> with E: From<GridstoreError> in Gridstore::iter Use a trait bound instead of Either to combine callback and gridstore errors, allowing `?` to work directly on GridstoreError. This simplifies callers by removing Either matching and io::Error conversion workarounds. --------- Co-authored-by: qdrant-claw <[email protected]> --------- Co-authored-by: qdrant-claw <[email protected]>