Skip to content

fix: prevent stale fallback snapshot writes - #28

Open
roncohen wants to merge 1 commit into
mainfrom
fix/fallback-snapshot-order
Open

roncohen wants to merge 1 commit into
mainfrom
fix/fallback-snapshot-order

Conversation

@roncohen

@roncohen roncohen commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What changed

Prevent older snapshots from replacing the newer fallback used at startup. File writers check flagStateVersion under an exclusive lock and replace the completed snapshot in place, without deleting the old file first. The Redis provider checks and writes in a single Lua script.

Snapshot formats, file names, and storage keys are unchanged. Redis needs EVAL, GET, and SET permissions.

Verification

  • dotnet test dotnet-sdk.sln passed on .NET 8 and .NET 10, including concurrent file writers and readers.
  • Ran the Redis provider against Redis 7.4.11 on both runtimes. Four independent writers made 404 save attempts per runtime; readers saw no regressions or incomplete snapshots.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: medium

no actionable findings

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