Expire backend-negative availability observations per slot - #105
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
It includes an unmentioned stateful-connection lifecycle change (scope/rollout risk) and needs a small follow-up adjustment to improve/verify the new negative-timestamp persistence behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates hybrid-cache negative availability tracking to store and expire authoritative “missing” observations per backend slot (rather than as a single shared timestamp), while keeping decode compatibility with older on-disk cache entry versions.
Changes:
- Add per-backend-slot negative-availability timestamps to
DiskCachedArticle, persist them as a new on-disk format version, and expire missing bits independently per slot. - Ensure hybrid-cache reads/mutations apply per-slot availability expiration before using entries, and preserve negative timestamps across ingest upserts.
- Remove stateful-session connection reuse (stateful sessions now always retire a pooled backend connection on exit).
File summaries
| File | Description |
|---|---|
| src/session/handlers/stateful.rs | Removes “reusable” stateful disposition and retires pooled connections on stateful session exit. |
| src/session/handlers/hybrid.rs | Aligns hybrid handoff finalization with stateful disposition changes (no reusable success completion). |
| src/session/backend.rs | Removes now-unused BackendResponseComplete::stateful_session() helper. |
| src/cache/hybrid.rs | Expires stale per-slot availability before treating cache entries as fresh; preserves timestamps across upserts. |
| src/cache/hybrid_codec.rs | Introduces V8 disk format with per-slot timestamps; adds per-slot expiration logic and a new regression test. |
| src/cache/availability_identity.rs | Adds AvailabilitySlot::index() to support per-slot timestamp indexing. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
c15f877 to
b5db963
Compare
da90e7c to
5f6a4cd
Compare
Summary
Branch-added tests
The stateful lifecycle adjustment is called out here because it is included in this branch's diff; it ensures a client-disconnected stateful lease cannot be reused while the per-slot cache state is being updated.