From 389de85ee2b855524a73fc6f69600c5ecba2d7e3 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 13:26:52 -0800 Subject: [PATCH] docs(invariants): the revocation ACK retry contract INV-WS-REVOKE-ACK-RETRY-001: asked again only after no answer (DeadlineExceeded, Unavailable), within the lease deadline and the 19 s closeout; the master answers a repeat of a recorded ACK as recorded while the line is revoking. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/design/invariants.md | 1 + 1 file changed, 1 insertion(+) diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index e6edf7c203..8cf749cbd5 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -311,6 +311,7 @@ stateDiagram-v2 | StopPending | StopPending | each sleep after a completed renewal is at most `stopPendingPoll` (250 ms); a renewal already in flight is not interrupted | `core/host/volume/workspace_lease.go` `renewDelay`, `Run` | `INV-WS-STOP-PENDING-001` | | StopPending | Valid | only the latest detach attempt, provably not applied, with serving resumed; an applied, fenced or unknown outcome, or an older attempt's resume, leaves StopPending | `core/frontend/durable/provider_chunk.go` `resumeAfterDetach`; `core/host/volume/workspace_runtime.go` `WorkspaceStopResumed`; `core/host/volume/workspace_lease.go` `ClearStopPending` | `INV-WS-STOP-PENDING-001` | | Fenced | Drained, Acked | the stop callback succeeded; only then, and only when revoked, the acknowledgement is sent | `core/host/volume/workspace_lease.go` `drain` | `INV-WS-REVOKE-ACK-001` | +| `INV-WS-REVOKE-ACK-RETRY-001` | A holder's revocation ACK is asked again only after a call that got no answer (`DeadlineExceeded`, `Unavailable`), within its lease deadline and the units' stop budget (19 s closeout); the master answers a repeat of a recorded ACK as recorded while the line is revoking. | M4 lease guard: Revoking → Acked; M2 Revoking → Revoked | `core/host/volume/workspace_lease.go` `drain`, `retryableAckError`; `cmd/blockvolume/process_exit.go` `workspaceLeaseCloseoutTimeout`; `core/authority/workspace.go` `AckWorkspaceRevocation` (a repeat returns nil) | `TestWorkspaceRevocationAckIsAskedAgainAfterALostAnswer`, `TestWorkspaceCloseoutFitsTheUnitsStopBudget` (`cmd/blockvolume/process_exit_ack_retry_test.go`); `TestWorkspaceRevocationAckIsCutAtTheLeaseDeadline` (`core/host/volume/workspace_ack_budget_test.go`) | — | ACTIVE | | (start) | Attaching, Refused | the volume's host lock `/run/sw-block/locks/.lock` is taken before the store opens; held by another live process, or its directory or file cannot be created or opened, refuses (`storage.ErrWALStoreLocked`, `ErrVolumeLockDirUnavailable`) | `core/frontend/durable/provider.go` `DurableProvider.lockVolumeOnHost` (from `ensureHandle`) | `INV-WS-ONE-PROCESS-PER-HOST-001` | | Attaching | Refused | a local root from another claim or behind HEAD's position (`layout.ErrStaleLocalRoot`): final typed refusal with a cure, no serving or retry | `core/frontend/durable/provider_layout.go` `startLayoutRoot`; `provider_chunk.go` `recoverChunk`, `chunkAuthorityWait` | `INV-WS-STALE-LOCAL-ROOT-001` | | (startup) | Refused | `--chunk-filer` is not the only filer of its group: a master lists another filer or several, or no master lists it within 60 s (`ErrNotSingleFiler`) | `core/frontend/chunkstore/single_filer.go` `CheckSingleFiler`; `cmd/blockvolume/chunk_remote.go` `newChunkWiring` | `INV-WS-SINGLE-FILER-001` |