Skip to content

syncsetup: an ownership check that finds another holder retires the send receipt first - #2180

Merged
santoshkumarradha merged 3 commits into
app/v3from
c40/watch-receipt
Nov 2, 2026
Merged

santoshkumarradha merged 3 commits into
app/v3from
c40/watch-receipt

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

What changes for a person

When the relay's watch says another computer took a chat over, this window's send receipt (the hold it publishes under) is now gone before anything is told the hold changed. Before, the first renewal notice arrived while the receipt was still on disk, so a reader woken by it could still find a receipt for a chat another computer holds.

Root cause

In Drive.CheckLease, the another-holder branch calls Batcher.Displaced, which marks the batcher stale, and that mark already wakes renewal readers. The receipt was only retired later, in becomeViewer. The merge of dev into app/v3 (#2099) moved the receipt out of the early retirement on purpose (a hold this computer still has keeps its receipt), but in this branch another computer is known to hold the chat. The branch now retires the receipt it read before the check, after in-flight seals settle and before Displaced, in a small helper.

Validation

Limits

A heartbeat that finds the hold gone without naming the holder still goes through the batcher's stale mark first. There the holder can be this computer at a newer fence, which keeps its receipt, so that path is unchanged.

🤖 Generated with Claude Code

…end receipt first

When CheckLease finds another computer holding the chat, Batcher.Displaced
marks the batcher stale, and that mark already wakes renewal readers through
endRenewals. The send receipt was only retired later, in becomeViewer, so a
reader woken by that first notice still found a receipt for a hold another
computer has (contract K2). The another-holder branch now retires the receipt
it read before the check, after in-flight seals and before Displaced, in a
small helper so CheckLease does not grow.
@santoshkumarradha
santoshkumarradha marked this pull request as ready for review November 2, 2026 11:23
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