Repository navigation
Conversation
Recovery seals only the epochs below the live one, so the slot must always hold the newest incarnation of a server_uuid and nothing older may be written under that uuid. claimMount broke this in three places: finding its own (uuid, epoch) in the slot it "refreshed" the body, which let a second process share the incarnation that another process had been allocated; an older allocation that reached the slot after a newer epoch could wait for a death certificate and replace it, and that write would never be sealed; and a next_writer_epoch of 0 (the encoding's absence value) was accepted when the counter was decoded. A claim now writes only above the slot's epoch: a newer own epoch in the slot throws ABORTED without a write; the own pair in the slot is never rewritten (gc_fenced → FencedSelf, otherwise LiveDoubleStart with the holder's body, and the caller takes a fresh epoch); a raced write that meets a newer own epoch fails at once instead of waiting for a certificate that cannot come; a zero next_writer_epoch is rejected. Nothing changes on the store. Closes backlog task CAS-298 (the claim part). Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]>
filimonov
force-pushed
the
fix/antalya-26.6/cas-mount-claim-monotonicity
branch
from
October 8, 2026 12:03
88953e6 to
17c7f28
Compare
k-morozov
self-requested a review
October 9, 2026 16:33
k-morozov
approved these changes
Oct 12, 2026
10 of 30 tasks
7 of 31 tasks
Member
Author
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.
A claim of the CAS mount slot now writes only above the slot's
writer_epoch. Three paths ofclaimMountcould leave two live incarnations under one epoch or put an older incarnation over a newer one; both break the rule recovery relies on — it seals only the epochs below the live one — so a write made under such an incarnation would never be sealed out.Why it matters for the lease
Each claim of the slot by the same
server_uuidtakes a freshwriter_epochfrom theepochcounter; GC fencing, farewell and recovery all speak in terms of "incarnation N is closed". The lease rework that follows (#2431) lets a server continue after its owngc_fencedpause by closing the old epoch and claiming a strictly greater one; that is only sound when no path can hand two processes the same epoch or let a stale allocation win.Changes
server_uuidwith a newer epoch in the slot: throwABORTEDwithout a write (cas_logeventnewer_epoch). An older allocation that reaches the slot late never replaces the newer incarnation, whatever certifies its end.(uuid, epoch)in the slot: never rewritten. The "refresh" branch is gone — our pair in the slot before we wrote anything means another process was allocated our epoch.gc_fenced→FencedSelf; otherwiseLiveDoubleStartwith the holder's body, and the caller takes a fresh epoch.next_writer_epoch = 0(the encoding's absence value) is rejected when the counter is decoded.Risks / notes
CaCasMountCoreis green;sab_equal_epoch_refresh(refresh restored) yields two live incarnations under one epoch,sab_stale_claim_replaces_neweryields an unsealed write.Testing
gtest_cas_mount.cpp,gtest_cas_mount_claim_conflicts.cpp,gtest_cas_server_root_format.cpp): own pair →LiveDoubleStartwith no write; newer own epoch →ABORTED; zero counter rejected; raced newer epoch fails at once; fenced own pair →FencedSelf. Three behaviour-preservation tests.CAS*gate: 2615 (release), 2619 (ASan, no error).Closes backlog task CAS-298 (the claim part).
Related: #2431
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
A CAS mount claim accepts only a strictly greater
writer_epoch: it no longer refreshes its own pair in the slot or replaces a newer incarnation of the same server, and a zero epoch counter is rejected.Documentation entry for user-facing changes
Updated
docs/en/antalya/cas/architecture/mounts-and-leases.md.CI/CD Options
Exclude tests:
Regression jobs to run: