Skip to content

Protect incoming KV prefix during live miss#448

Open
JordiPosthumus wants to merge 1 commit into
antirez:mainfrom
JordiPosthumus:fix/protect-incoming-kv-prefix-cache-only
Open

Protect incoming KV prefix during live miss#448
JordiPosthumus wants to merge 1 commit into
antirez:mainfrom
JordiPosthumus:fix/protect-incoming-kv-prefix-cache-only

Conversation

@JordiPosthumus

@JordiPosthumus JordiPosthumus commented Jun 23, 2026

Copy link
Copy Markdown

Summary

  • Protect disk KV checkpoints that are valid prefixes of the incoming prompt while storing old live state after a live-cache miss.
  • Add a regression test for the live-miss eviction case.

Why

On a live-cache miss, ds4-server stores the old live checkpoint before trying to load a disk fallback. Under disk pressure, that store can evict a checkpoint that prefixes the incoming prompt. When that happens, ds4 has to cold-prefill even though a valid disk fallback existed.

This change gives those incoming-prompt prefix checkpoints a very high eviction score during the pre-fallback store, so unrelated cache entries are evicted first.

Test

  • make ds4-server
  • make test

@fry69

fry69 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Can you please fix your PR text? It's garbled.

There are still humans reading PRs... (maybe not for long, though)

@JordiPosthumus

Copy link
Copy Markdown
Author

ok, I spoke to my people ! Better? :-D

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.

2 participants