Skip to content

feat(redis): read entry frames by their logical expiration - #578

Draft
cosmin-staicu wants to merge 1 commit into
feat/conditional-refreshfrom
feat/entry-frame-read
Draft

cosmin-staicu wants to merge 1 commit into
feat/conditional-refreshfrom
feat/entry-frame-read

Conversation

@cosmin-staicu

@cosmin-staicu cosmin-staicu commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Every node learns to read the entry frame before any node writes one, so a mixed fleet stays readable. Stacked on #574; this PR shows only its own layer.

Changes

  • Reserves format id 0x0E for the entry frame: no value serializer may claim it, and it stays a valid event id.
  • Adds the frame codec: version, flags, the frame's own expiration, a stale window, and optional ETag and Last-Modified around the inner value bytes.
  • Value reads unwrap a frame and judge it by its logical expiration: the earlier of the frame's expiration and the key's TTL less the window, read on the monotonic clock from before the read is sent. A key without a TTL never makes a framed value fresh.
  • The format inventory and sweeper count framed values and never rewrite them; key move and the byte codec carry a frame's life to the other store.
  • On a cache with a shared tier, a refresh event drops a peer's local copy instead of renewing it, so the peer's next read takes the value and its expiration from the shared tier (listed under Changed in the CHANGELOG).
  • A value read from a windowed frame keeps monotonic bounds in the local tier, so a UTC clock step cannot extend it, and layered, hash and forwarding tiers keep no unbounded copy.

No frame is written yet; writes come in the next PR of the stack.

Tests

Release, net10.0 and net8.0, with Redis: the full UiPath.Caching.Tests project passed; new classes cover the codec grammar, framed reads on both clocks, the refresh-event drop, and the local bounds.

Reserve format id 0x0E and add the entry frame codec.
Read framed values using wall-clock expiration and monotonic Redis lifetime.
Teach key move and format inventory to recognize frames.
Drop peer copies on refresh and carry monotonic bounds into local copies.

Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
@cosmin-staicu
cosmin-staicu added this pull request to stack #580 November 29, 2026 21:53
@cosmin-staicu cosmin-staicu changed the title feat/entry frame read feat(redis): read entry frames by their logical expiration Nov 29, 2026

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