Skip to content

Preserve cached hits from the youngest mature split - #6902

Open
PSeitz wants to merge 1 commit into
quickwit-oss:mainfrom
PSeitz:improve_cache
Open

PSeitz wants to merge 1 commit into
quickwit-oss:mainfrom
PSeitz:improve_cache

Conversation

@PSeitz

@PSeitz PSeitz commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Exact query repeats can lose their cached pruning threshold when the newest splits merge away. Older splits often have only count-only cache entries, so the next refresh warms them up again before it can discard their hits.

Preserve a cached hit list from the youngest mature split, which is no longer eligible for merging. Its hits can establish a threshold on later refreshes and allow older count-only entries to be reused before warmup.

Changes

  • Send split maturity from root to leaf through SplitIdAndFooterOffsets.is_mature.
  • For timestamp-descending searches with hits and caching enabled, exempt the youngest fully time-covered mature split from top-hit pruning, including upfront match-all pruning and pruning after warmup.
  • Add regression coverage for replacement splits, sliding windows, sparse/zero matches, boundary-crossing splits, count-only requests, and disabled caching.

Only one mature split is protected. If it has fewer than start_offset + max_hits matches, its cached hits alone cannot establish a threshold; older splits may still need searching. Collecting its hits adds work when it would otherwise have been pruned.

The protocol field is additive and defaults to false for older requests. No migration is required.

@PSeitz
PSeitz requested a review from a team as a code owner October 12, 2026 18:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T08:06:30.823459Z f0b4f52 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 23a1bf89b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// The number of docs in the split
uint64 num_docs = 6;
// Whether the split is mature and no longer eligible for merging.
bool is_mature = 7;

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 Document the new split-maturity protocol

is_mature is a new root-to-leaf protobuf field that changes which split searches are exempted from pruning, but this patch leaves the protocol/cache documentation unchanged (docs/overview/concepts/querying.md:96 only gives a generic description of partial-result caching). Without documenting the false compatibility default and the timestamp-descending mature-split scope, operators and future protocol maintainers cannot reason about rolling upgrades or the added search work; add the corresponding protocol/cache documentation.

AGENTS.md reference: AGENTS.md:L23-L24

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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