Skip to content

Expire backend-negative availability observations per slot - #105

Merged
mjc merged 4 commits into
nntpp-29-hybrid-cache-weightfrom
nntpp-30-negative-availability-ttl
Sep 11, 2026
Merged

Expire backend-negative availability observations per slot#105
mjc merged 4 commits into
nntpp-29-hybrid-cache-weightfrom
nntpp-30-negative-availability-ttl

Conversation

@mjc

@mjc mjc commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • store negative-availability timestamps per backend slot
  • expire each backend observation independently
  • retain compatibility for older on-disk cache versions
  • retire stateful session connections on client disconnect as part of this stacked branch's lifecycle policy

Branch-added tests

  • A deterministic cache test updates one backend’s negative observation, advances time, and verifies expiration does not incorrectly preserve or invalidate other slots.
  • A codec roundtrip test verifies V8 persists and restores per-backend negative timestamps.
  • Legacy serialized availability versions and property-based availability behavior remain covered.

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.

Copilot AI lite review requested due to automatic review settings September 5, 2026 21:48
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Team

Run ID: fed68932-bcb6-40ae-84d5-93654372e917

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Comment thread src/cache/hybrid_codec.rs
Comment thread src/cache/hybrid_codec.rs
Comment thread src/session/handlers/stateful.rs
@mjc
mjc force-pushed the nntpp-29-hybrid-cache-weight branch from c15f877 to b5db963 Compare September 5, 2026 23:28
@mjc
mjc force-pushed the nntpp-30-negative-availability-ttl branch from da90e7c to 5f6a4cd Compare September 5, 2026 23:28
@mjc
mjc merged commit 0dd3347 into nntpp-29-hybrid-cache-weight Sep 11, 2026
7 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.

2 participants