Skip to content

fix(lock): renew held and adopted lock slots in the background - #83

Closed
mattmattox wants to merge 1 commit into
mainfrom
claude/lock-lease-renewal
Closed

mattmattox wants to merge 1 commit into
mainfrom
claude/lock-lease-renewal

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

First of the three lock follow-ups: (a) lease renewal, (b) take over a lock only after its holder is released, (c) a pre-write ownership check.

Before this, a node renewed a claim only when another operation joined the hold. So one operation, or a journal replay, that ran past 15s let its claims go stale, and another node could take a lock that was still in use.

  • Mount starts a renewer. It rewrites every record this node holds, and every slot it adopted for a replay, once the slot is 2.5s old.
  • Cost: one 4 KB write per held record about every 3s.
  • Behavior change: two live nodes that each wait for the other's record no longer both proceed after 15s. The first wait gives up after 30s with EIO. A hold that a goroutine leaks stays held until unmount.
  • A paused node still loses its locks after 15s. (b) and (c) cover that.
  • Tests: with either half of the renewer turned off, its test fails.

🤖 Generated with Claude Code

A node renewed a claim only when another operation joined the hold, so a
single operation or a journal replay that ran past 15s let its claims go
stale and another node could take a lock still in use. Mount now starts
a renewer that rewrites held records and adopted slots once they are
2.5s old.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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