Skip to content

Fix[mqbs::FileStore]: Track write-head leaseId on applied records - #1681

Closed
kaikulimu wants to merge 1 commit into
bloomberg:mainfrom
kaikulimu:track-write-head-lease-id
Closed

Fix[mqbs::FileStore]: Track write-head leaseId on applied records #1681
kaikulimu wants to merge 1 commit into
bloomberg:mainfrom
kaikulimu:track-write-head-lease-id

Conversation

@kaikulimu

@kaikulimu kaikulimu commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Makes a FileStore replica advance its write head (the (leaseId, seqNum) cursor) to the leaseId of every record it applies in processStorageEvent, not just during partition-sync. Previously the leaseId was bumped only for partition-sync events, so a record carrying a higher leaseId applied through any other path left the write head — and therefore writeHeadSeqNum() — lagging the record just written.
  • A lagging write head desyncs the reported PSN and lets a later setActivePrimary for the new leaseId reset the (now stale) sequence number to zero, which can cascade into a spurious out-of-sync/abort.
  • In the FSM workflow this can arise when a record of a new lease is applied before the primary's active-status advisory (setActivePrimary) has been processed. The write head now follows the record so the PSN stays correct regardless of ordering.

Signed-off-by: Yuan Jing Vincent Yan <yyan82@bloomberg.net>
@kaikulimu
kaikulimu force-pushed the track-write-head-lease-id branch from 3b8cd14 to 0abff77 Compare August 3, 2026 19:53
@kaikulimu kaikulimu changed the title WIP Fix[mqbs::FileStore]: Alarm on higher leaseId in non-sync event Fix[mqbs::FileStore]: Track write-head leaseId on applied records Aug 3, 2026
@kaikulimu
kaikulimu marked this pull request as ready for review August 3, 2026 20:00
@kaikulimu
kaikulimu requested a review from a team as a code owner August 3, 2026 20:00
@kaikulimu
kaikulimu requested a review from 678098 August 3, 2026 20:02
@kaikulimu
kaikulimu requested a review from dorjesinpo August 3, 2026 21:09
@kaikulimu kaikulimu closed this Aug 3, 2026
@kaikulimu
kaikulimu deleted the track-write-head-lease-id branch August 3, 2026 21:27
@kaikulimu

Copy link
Copy Markdown
Collaborator Author

Accidentally closed. Now the changes are on #1687

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.

2 participants