Skip to content

UniversalIO: generic RequestId - #8601

Merged
xzfc merged 5 commits into
devfrom
uio-generic-request-id
Apr 7, 2026
Merged

xzfc merged 5 commits into
devfrom
uio-generic-request-id

Conversation

@xzfc

@xzfc xzfc commented Apr 3, 2026

Copy link
Copy Markdown
Member

Follow up for #8599.

Makes RequestId to be a generic parameter of UniversalRead methods.
Lets callers to decide what to put into RequestId.

The second commit is an example when it can be convenient.

Also, this change makes IoUringReadIter/IoUringReadMultiIter separation unnecessary.
It gives performance improvement for callers that do not need RequestId:

io_uring/8bytes/read_batch_small_sequential
                        time:   [1.1978 µs 1.1996 µs 1.2016 µs]
                        change: [−5.2882% −5.1465% −5.0014%] (p = 0.00 < 0.05)
                        Performance has improved.
io_uring/1KiB/read_batch_small_sequential
                        time:   [1.7451 µs 1.7492 µs 1.7528 µs]
                        change: [−4.2483% −3.9277% −3.5943%] (p = 0.00 < 0.05)
                        Performance has improved.

Comment thread lib/gridstore/src/pages.rs Outdated
/// - `SmallVec<[usize; 2]>` — the offset within the value buffer that each page range
/// corresponds to.
/// A value may span across two consecutive pages if it starts near the end of a page.
/// Returns `(buffer_offset, page_index, range)` entries that together cover the full

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what exactly buffer_offset, page_index, range are?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comment: 99dacf3

@xzfc
xzfc force-pushed the uio-uring-flat-state branch 3 times, most recently from d3c2d82 to 522b6a2 Compare April 7, 2026 08:57
Base automatically changed from uio-uring-flat-state to dev April 7, 2026 12:31
xzfc added 3 commits April 7, 2026 12:32
Now we don't need two separate `SmallVec`s as we can put `buffer_offset`
into `RequestId`.

@ffuugoo ffuugoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs rebase, but LGTM.

I'd rename RequestId into more generic Meta (user supplies arbitrary "metadata" with request, not strictly an "id"), but we can do this in a follow-up.

@xzfc
xzfc force-pushed the uio-generic-request-id branch from 46812f7 to f965610 Compare April 7, 2026 16:42
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 880d0819-ee8d-4e79-b490-5070b2057224

📥 Commits

Reviewing files that changed from the base of the PR and between 07f4970 and f965610.

📒 Files selected for processing (13)
  • lib/common/common/benches/universal_io.rs
  • lib/common/common/src/universal_io/disk_cache/mod.rs
  • lib/common/common/src/universal_io/io_uring/mod.rs
  • lib/common/common/src/universal_io/io_uring/read_iter.rs
  • lib/common/common/src/universal_io/io_uring/runtime.rs
  • lib/common/common/src/universal_io/io_uring/tests.rs
  • lib/common/common/src/universal_io/mmap.rs
  • lib/common/common/src/universal_io/read.rs
  • lib/common/common/src/universal_io/wrappers/read_only.rs
  • lib/common/common/src/universal_io/wrappers/typed.rs
  • lib/gridstore/src/pages.rs
  • lib/segment/src/vector_storage/dense/immutable_dense_vectors.rs
  • src/tonic/api/storage_read_api/mod.rs

📝 Walkthrough

Walkthrough

This refactoring modifies the UniversalRead trait and all implementations to carry per-I/O metadata (Meta) through batch and multi-file read operations. The API changes replace index-based identification (usize, FileIndex) with caller-provided metadata attached to each read operation. All read_batch, read_iter, read_multi, and read_multi_iter methods now accept iterators of (Meta, ReadRange) or (Meta, &Self, ReadRange) tuples and invoke callbacks or return results with the associated metadata instead of computed indices. Implementations across disk caching, io_uring, memory mapping, wrappers, and all call sites are updated consistently.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • ffuugoo
  • generall
  • coszio
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'UniversalIO: generic RequestId' directly summarizes the main change: making RequestId a generic parameter for UniversalRead methods.
Description check ✅ Passed The description clearly relates to the changeset by explaining the purpose (making RequestId generic), the benefit (performance improvement), and referencing a follow-up commit example.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch uio-generic-request-id

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@xzfc
xzfc merged commit 2d9d953 into dev Apr 7, 2026
15 checks passed
@xzfc
xzfc deleted the uio-generic-request-id branch April 7, 2026 17:10
This was referenced Apr 27, 2026
timvisee pushed a commit that referenced this pull request May 8, 2026
* IoUringState: generic `RequestId`

* UniversalRead: generic `RequestId`

* Simplify `gridstore::Pages::get_page_value_ranges`

Now we don't need two separate `SmallVec`s as we can put `buffer_offset`
into `RequestId`.

* Better doc comment

* Rename `RequestId` -> `Meta`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants