Skip to content

feat(storage): cache immutable split byte ranges - #6707

Open
congx4 wants to merge 5 commits into
quickwit-oss:congxie/split-range-cache-4-builderfrom
congx4:congxie/split-range-cache-5-decorator
Open

feat(storage): cache immutable split byte ranges#6707
congx4 wants to merge 5 commits into
quickwit-oss:congxie/split-range-cache-4-builderfrom
congx4:congxie/split-range-cache-5-decorator

Conversation

@congx4

@congx4 congx4 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a read-only Storage decorator that caches exact {object URI, byte range} slices in the process-wide Foyer hybrid cache.
  • Single-flight via get_or_fetch; lower storage errors pass through unchanged; Foyer errors fail open to one direct lower read.
  • Values that exceed max_entry_size or the Foyer block slot stay memory-only. Writes are rejected.
  • Open and close the cache from searcher startup when split_range_disk_cache is configured.
  • Wrap storage in open_split_bundle before the footer fetch so RAM footer cache → optional whole-split cache → Foyer → caller storage serves both footer and body reads.

Stack

Test plan

  • cargo test -p quickwit-storage --lib split_range
  • cargo test -p quickwit-search split_range_cache_layer
  • cargo test -p quickwit-serve --all-features setup_searcher
  • cargo clippy -p quickwit-search --all-features --tests -- -D warnings
  • CI

@congx4
congx4 requested a review from a team as a code owner August 18, 2026 18:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 359def0140

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quickwit/quickwit-storage/src/split_range_cache/storage.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d42519e7c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +173 to +178
let object_uri = self
.inner
.uri()
.join(path)
.map_err(|error| StorageErrorKind::Internal.with_error(error))?
.into_string();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include the backing endpoint in persistent cache keys

When an S3-compatible deployment changes its configured endpoint while retaining the disk-cache directory, this key remains only s3://bucket/path plus the byte range. S3CompatibleObjectStorage stores the endpoint solely in its client configuration while uri() returns the original S3 URI, so a different endpoint with the same bucket/key can receive a recovered entry from the previous backend and return incorrect split bytes. Namespace persistent keys by the effective backend endpoint (or invalidate the cache when that identity changes).

Useful? React with 👍 / 👎.

Comment thread quickwit/quickwit-storage/src/split_range_cache/storage.rs
@congx4
congx4 requested a review from a team as a code owner August 18, 2026 20:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24d1a650f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quickwit/quickwit-search/src/service.rs
@congx4
congx4 force-pushed the congxie/split-range-cache-5-decorator branch from 24d1a65 to d5dac9f Compare August 18, 2026 20:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

https://github.com/quickwit-oss/quickwit/blob/d5dac9f847af8f33dc61e548ac3fcea566daaefc/quickwit-storage/src/split_range_cache/storage.rs#L61
P2 Badge Reject blocks smaller than the reserved index

When block_size is below 4 KiB, such as a 2 KiB block with a 1 KiB maximum entry, the configuration passes SplitRangeDiskCacheConfig::validate, but the first cacheable read subtracts the 4 KiB blob index here. This underflows and panics in checked builds; in release builds it wraps to a huge slot size and incorrectly attempts disk admission. Validate that the block exceeds the reserved index or use checked subtraction and bypass disk admission.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant