fix: implement multi-replica distributed LockStore with Redis Lua scripts and monotonic fencing tokens (#378) - #386
Draft
s6pa1rta3n-lab wants to merge 1 commit into
Draft
Conversation
…ripts and monotonic fencing tokens - Add production RedisLockStore backed by atomic Lua scripts for acquisition, renewal, release, and fencing token validation - Support failover epoch layering and WAIT replication acknowledgment to guarantee monotonicity across restarts and failovers - Enhance FencingTokenGenerator with epoch multipliers and store synchronization - Add comprehensive multi-process SIGSTOP chaos tests verifying stale writer rejection across independent OS processes - Add test suites for simulated store failover monotonicity, concurrent acquisition storms, renewal-vs-expiry races, and store unavailability - Document full failure-mode and recovery matrix matching ttl_manager.rs architecture
s6pa1rta3n-lab
force-pushed
the
fix-issue-378
branch
from
September 1, 2026 11:08
4e24c93 to
3da2886
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #378 by implementing a production-grade multi-replica
LockStorebacked by Redis (RedisLockStore) with atomic Lua scripts for acquisition, renewal, release, and fencing token validation.Key Changes
RedisLockStore:LockStoretrait backed by atomic Lua scripts executing single round-trip acquisitions, monotonic sequence increments, server-side TTL registrations, and stale write fencing.epoch) and optionalWAITreplication acknowledgment guarantees cross-failover monotonicity without token reuse.FencingTokenGeneratorwith epoch multipliers andupdate_if_greaterstore synchronization methods.lock_sigstop_test.rsto include a true multi-process test where a child process is paused with OSSIGSTOP, lock expires on Redis, secondary replica acquires with a higher token, and the resumed child's write is rejected withFencingTokenRejected.ttl_manager.rsstyle.Acceptance Criteria Checklist
LockStoreimplementation exists that is safe across ≥2 real, independent OS processes coordinating through a real backing store (RedisLockStore).test_multi_process_sigstop_fencing_rejection).test_failover_monotonicity_no_token_reuse).ttl_manager.rs-style documentation is extended to cover this store, including what happens on backing-store unavailability mid-cycle.cargo testsuite stays green (all 37 unit/lib tests and integration tests pass).Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC