Skip to content

fix: prevent stale fallback snapshot writes - #18

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

  • Serialize file fallback writers per namespace. Recheck the stored flagStateVersion before replacing the file so a late save cannot roll back the fallback used at startup.
  • Update the Redis example to compare the version and write in one Lua script.

File names, Redis keys, and snapshot formats are unchanged. The Redis example requires EVAL, GET, and SET permissions.

Verification

  • pytest -q: 1,857 passed; 10 skipped. Ruff and mypy passed.
  • Ran the file provider with separate writer processes and the README example against Redis 7.4.11 with four independent writers. Both retained the highest version.

@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

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