Skip to content

Conversation

@Sicheng-Pan
Copy link
Contributor

@Sicheng-Pan Sicheng-Pan commented Dec 10, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Rename prefetch_* to load_* to better indicate its usage. Prefetch is for lower priority data warmup, and should be used in a fire and forget fashion. Load higher priority and could be blocked on.
    • Make load_blocks use P0 priority instead of P1 when fetching blocks. Previously prefetch use P1 priority and led to long tail latency on log materialization.
  • New functionality
    • N/A

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?

Observability plan

What is the plan to instrument and monitor this change?

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

Sicheng-Pan commented Dec 10, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Sicheng-Pan Sicheng-Pan marked this pull request as ready for review December 10, 2025 01:15
@propel-code-bot
Copy link
Contributor

Renamed block loading helpers and elevated priority to P0

This PR replaces the prefetch_* nomenclature with load_* across the record segment, regex literal provider, and full-text index code paths to clarify that these routines may be on the hot path and should block until data is available. Under the hood, the blockfile reader now exposes load_data_for_keys, and ArrowBlockfileReader::load_blocks escalates its fetch priority from P1 to P0, ensuring urgently needed blocks are fetched ahead of background warming tasks. Call sites within log materialization and segment readers have been updated to pass iterators instead of slices to align with the new signatures.

Key Changes

• Renamed record-segment helper methods from prefetch_* to load_* and adjusted call sites to supply iterators (impl Iterator<Item = …>).
• Introduced BlockfileReader::load_data_for_keys with a no-op for in-memory readers and mapped it to Arrow’s block loader using StorageRequestPriority::P0.
• Updated regex literal and full-text index providers to use the new load_ngrams naming.
• Changed ArrowBlockfileReader::load_blocks to request blocks with StorageRequestPriority::P0 for latency-sensitive operations.

Affected Areas

• rust/segment/src/blockfile_record.rs
• rust/segment/src/types.rs
• rust/blockstore/src/types/reader.rs
• rust/blockstore/src/arrow/blockfile.rs
• rust/types/src/regex/literal_expr.rs
• rust/index/src/fulltext/types.rs

This summary was automatically generated by @propel-code-bot

@HammadB HammadB merged commit bbaa6c9 into main Dec 10, 2025
66 checks passed
chroma-droid pushed a commit that referenced this pull request Dec 10, 2025
## Description of changes

_Summarize the changes made by this PR._

- Improvements & Bug fixes
- Rename `prefetch_*` to `load_*` to better indicate its usage. Prefetch
is for lower priority data warmup, and should be used in a fire and
forget fashion. Load higher priority and could be blocked on.
- Make `load_blocks` use `P0` priority instead of `P1` when fetching
blocks. Previously prefetch use `P1` priority and led to long tail
latency on log materialization.
- New functionality
  - N/A

## Test plan

_How are these changes tested?_

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Migration plan

_Are there any migrations, or any forwards/backwards compatibility
changes needed in order to make sure this change deploys reliably?_

## Observability plan

_What is the plan to instrument and monitor this change?_

## Documentation Changes

_Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
Sicheng-Pan added a commit that referenced this pull request Dec 10, 2025
This PR cherry-picks the commit bbaa6c9
onto release/2025-12-05. If there are unresolved conflicts, please
resolve them manually.

Co-authored-by: Macronova <[email protected]>
@Sicheng-Pan Sicheng-Pan deleted the 12-09-_enh_load_blocks_given_keys_under_p0_priority branch December 10, 2025 03:36
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