Skip to content

feat(redis): write entry frames with a stale window - #579

Draft
cosmin-staicu wants to merge 1 commit into
feat/entry-frame-readfrom
feat/entry-frame-write
Draft

cosmin-staicu wants to merge 1 commit into
feat/entry-frame-readfrom
feat/entry-frame-write

Conversation

@cosmin-staicu

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

Copy link
Copy Markdown
Member

Summary

Writes an expired copy into Redis for a stale window, behind an opt-in option and format negotiation. Stacked on #578; this PR shows only its own layer.

Changes

  • Adds EntryMetadataEnabled and the frame1 advertisement: a node writes frames only while every visible reader can read them, and rechecks the gate before each send.
  • Adds two policy options for the stale window. A write under such a policy stores a frame whose key TTL is the lifetime plus the window, on every write path.
  • A write counts its deadline from the moment the library first saw it, on both clocks, and the layered cache hands that anchor to the Redis tier, so a UTC clock step before the send adds no life.
  • Key commands (ContainsAsync, TimeToLiveAsync, ExpireTimeAsync, TryAddAsync) answer by the frame's logical expiration; a refresh never extends a windowed frame.
  • Fills, stamped writes and SetIfChangedAsync replace an expired frame by compare-and-set.

With EntryMetadataEnabled off, every command and stored byte is as before.

Tests

Release, net10.0 and net8.0, with Redis 7.4 and 6.2: write, key-command, refresh, rollback and fill integration classes, the negotiation classes, and the allocation pins (unchanged).

Gate EntryMetadataEnabled writes on frame1 format negotiation.
Add FailSafeDistributedEnabled and FailSafeDistributedMaxStaleAge, and anchor windowed writes.
Answer key commands by the frame’s logical expiration.
Use compare-and-set to let fills replace an expired frame.

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 write feat(redis): write entry frames with a stale window 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