Skip to content

feat(search): add disk cache metrics and disable fast-field RAM cache conditionally - #6709

Open
congx4 wants to merge 6 commits into
quickwit-oss:congxie/split-range-cache-5-decoratorfrom
congx4:congxie/split-range-cache-6-fast-field-cache
Open

feat(search): add disk cache metrics and disable fast-field RAM cache conditionally#6709
congx4 wants to merge 6 commits into
quickwit-oss:congxie/split-range-cache-5-decoratorfrom
congx4:congxie/split-range-cache-6-fast-field-cache

Conversation

@congx4

@congx4 congx4 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • emit disk cache related metrics from pomsky and foyer.
  • When split_range_disk_cache is set and fast_field_cache / fast_field_cache_capacity is omitted, the long-lived .fast RAM cache now defaults to capacity 0.
  • Configs without the Foyer disk cache still default fast_field_cache to 1 GiB. An explicit capacity (including 0 or 1G) is always honored.
Config Fast-field RAM cache
No Foyer, fast_field_cache omitted 1 GiB (unchanged)
Foyer on, fast_field_cache omitted off
Either, fast field capacity set as written

Stacked on #6707.

Test plan

  • cargo test -p quickwit-config --lib node_config
  • cargo test -p quickwit-search test_zero_capacity_fast_field
  • cargo test -p quickwit-search test_nonzero_fast_field
  • Confirm a node YAML with only split_range_disk_cache leaves the .fast RAM cache empty, and adding fast_field_cache_capacity: 1G keeps both

Made with Cursor

Omit fast_field_cache while split_range_disk_cache is set now means
capacity 0, and SearcherContext skips the long-lived .fast cache in
that case. Existing configs without Foyer still default to 1 GiB.

Co-authored-by: Cursor <cursoragent@cursor.com>
@congx4
congx4 requested a review from a team as a code owner August 19, 2026 14:50
Drop SearcherConfigDeser. Keep omitted fast_field_cache as None and
apply the 1 GiB vs empty default from SearcherConfig.

Co-authored-by: Cursor <cursoragent@cursor.com>

@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: f05c375c2c

ℹ️ 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 +478 to +480
let storage_long_term_cache = if fast_field_cache.capacity().as_u64() == 0 {
Arc::new(QuickwitCache::empty())
} else {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve virtual-cache probes at zero capacity

When an explicit fast-field configuration has capacity 0 but includes virtual_caches, this shortcut removes the .fast route entirely. Previously QuickwitCache::new still constructed MemorySizedCache, whose get/put paths feed every virtual cache even though the real cache retains nothing, allowing operators to measure hypothetical policies and capacities. With QuickwitCache::empty(), those configured probes receive no accesses and their metrics become misleading; only bypass construction when virtual_caches is also empty.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If we don't need the fast field cache then we don't need virtual_caches for fast field cache as well.

congx4 and others added 3 commits August 19, 2026 11:20
Co-authored-by: Cursor <cursoragent@cursor.com>
Match the documented searcher example to a realistic large-node layout
and drop write_policy so the default write-on-eviction is obvious.
Record request outcomes, admission bypasses, and Foyer fail-open on
the decorator path, and forward Foyer's mixtrics to the process
metrics recorder.
@congx4
congx4 requested a review from a team as a code owner August 19, 2026 15: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

https://github.com/quickwit-oss/quickwit/blob/530a96289528aac7fc11f9576b5e9af229e9d0ea/quickwit-storage/src/split_range_cache/metrics.rs#L171-L173
P2 Badge Preserve Foyer's requested histogram buckets

When split_range_disk_cache is enabled, this overload silently discards every bucket set supplied by Foyer. Quickwit's Prometheus recorder only configures custom buckets from quickwit_metrics::histogram_buckets() when build_recorder runs, while metrics::describe_histogram! cannot convey bucket boundaries, so these Foyer histograms are exported with generic defaults instead of their intended latency/size boundaries. This makes bucket distributions and derived quantiles misleading; register the known Foyer bucket sets with the Prometheus builder/inventory rather than dropping them here.


https://github.com/quickwit-oss/quickwit/blob/530a96289528aac7fc11f9576b5e9af229e9d0ea/quickwit-storage/src/split_range_cache/storage.rs#L218-L220
P2 Badge Increment fail-open only after fallback succeeds

When a Foyer failure is followed by an object-storage failure, this increments split_range_disk_cache_fail_open_total before the fallback read completes, even though the request was not served from lower storage as the documented metric description states. This makes the counter misleading during compound cache and object-store outages; increment it only after a successful fallback, or explicitly define and document it as an attempted fail-open counter.


https://github.com/quickwit-oss/quickwit/blob/530a96289528aac7fc11f9576b5e9af229e9d0ea/quickwit-storage/src/split_range_cache/metrics.rs#L279-L282
P2 Badge Attach configured global labels to Foyer metrics

When operators set QW_METRICS_LABELS, this adapter builds Foyer metric keys solely from Foyer's own label names and values, bypassing the global labels that Quickwit's metric macros append via quickwit_metrics::__labels_env_var(). Consequently the new Foyer series lack labels such as environment or region even though docs/reference/cli.md promises those labels on every Quickwit metric, so dashboard filters can omit these series or aggregate them across environments. Append the configured global labels when constructing these metric keys.

ℹ️ 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".

Use 15G memory, 2G buffer pool, and 3G submit queue in the searcher
example so it matches a realistic node layout.

@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: 6c06357093

ℹ️ 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 +171 to +173
_buckets: Vec<f64>,
) -> BoxedHistogramVec {
self.register_histogram_vec(name, desc, label_names)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve Foyer's histogram buckets

When Foyer registers a histogram through this method, the supplied bucket boundaries are discarded. Both the Prometheus and OTLP recorders configure custom boundaries only from quickwit_metrics::histogram_buckets() during exporter initialization, so the later describe_histogram! call cannot restore Foyer's boundaries; Foyer latency histograms will therefore use exporter defaults and report a misleading distribution. Register the supplied boundaries with the exporters instead of ignoring them.

Useful? React with 👍 / 👎.

@congx4 congx4 changed the title feat(search): disable fast-field RAM cache when Foyer is enabled feat(search): add metrics and disable fast-field RAM cache if it is not specified when Foyer is enabled Aug 19, 2026
@congx4 congx4 changed the title feat(search): add metrics and disable fast-field RAM cache if it is not specified when Foyer is enabled feat(search): add disk cache metrics and disable fast-field RAM cache if it is not specified when Foyer is enabled Aug 19, 2026
@congx4 congx4 changed the title feat(search): add disk cache metrics and disable fast-field RAM cache if it is not specified when Foyer is enabled feat(search): add disk cache metrics and disable fast-field RAM cache conditionally when Foyer is enabled Aug 19, 2026
@congx4 congx4 changed the title feat(search): add disk cache metrics and disable fast-field RAM cache conditionally when Foyer is enabled feat(search): add disk cache metrics and disable fast-field RAM cache conditionally Aug 19, 2026
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