Skip to content

Fix split cache metrics#76

Merged
rdettai-sk merged 1 commit into
sekoiafrom
fix-split-cache-metrics
Jul 4, 2026
Merged

Fix split cache metrics#76
rdettai-sk merged 1 commit into
sekoiafrom
fix-split-cache-metrics

Conversation

@rdettai-sk

Copy link
Copy Markdown
Collaborator

Description

We have search split cache evictions at 1000x the download rate. I always found that a bit weird :-)

How was this PR tested?

Describe how you tested this PR.

Copilot AI 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.

Pull request overview

This PR adjusts how split-cache Prometheus metrics are recorded so eviction metrics better reflect actual committed evictions (addressing inflated eviction rates compared to downloads).

Changes:

  • Centralizes “split added to disk” and “split evicted” metric updates into helper functions.
  • Records eviction metrics only after eviction is confirmed (no rollback), rather than during intermediate removal/reinsert flows.
  • Adds metric recording when acknowledging pre-existing on-disk splits and when registering a split as downloaded.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread quickwit/quickwit-storage/src/split_cache/split_table.rs
Comment on lines -155 to -170
crate::metrics::STORAGE_METRICS
.searcher_split_cache
.in_cache_count
.dec();
crate::metrics::STORAGE_METRICS
.searcher_split_cache
.in_cache_num_bytes
.sub(num_bytes as i64);
crate::metrics::STORAGE_METRICS
.searcher_split_cache
.evict_num_items
.inc();
crate::metrics::STORAGE_METRICS
.searcher_split_cache
.evict_num_bytes
.inc_by(num_bytes);

@rdettai-sk rdettai-sk Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

the issue here was that remove is called for mutations that don't necessarily imply an eviction (the split is usually added back before releasing the lock

@rdettai-sk rdettai-sk merged commit 216c1ad into sekoia Jul 4, 2026
4 checks passed
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