A delete admitted as never started that stopped before it marked HEAD,
after which the holder claimed HEAD, was refused at the master on every
rerun, before the catalog step that gives the reservation back: the
volume stayed reserved for ever. A rerun whose token already holds the
reservation (or a committed one) now skips the verdict; the catalog
step's HEAD fence refuses the live HEAD and gives back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 0, S4 (volume side): --master-tls-cert, --master-tls-key and
--master-ca put the volume host's master link and the GC epoch pull on
mutual TLS (the filer links are unchanged). The start is refused when the
node certificate's CN differs from --server-id, when the set is partial,
or together with --allow-external-status-bind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 0, S4 (master side): --tls-cert, --tls-key, --tls-client-ca and
--role-file together turn on mutual TLS and per-call authorization; a
partial set, or authentication with --insecure-external-bind, is refused;
the authenticated listener may bind any address. SIGHUP reloads the role
file (a bad file keeps the previous table and says so). The start-up line
gives the master's own certificate's expiry; development mode repeats its
UNAUTHENTICATED warning once a minute.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 0, S4 (transport): TLSFiles (cert, key, CA: all or none, checked at
start), ServerCredentials (client certificate required and verified to the
CA), ClientCredentials, DialMaster (TLS or development-mode plaintext), and
a 24 h connection age. Both sides read their certificate at every
handshake, so a rotated file takes effect without a restart. Dial (the
SeaweedFS filer links) is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 0, S3 (master part): masterRules covers all 24 blockmaster methods
(PHASE0-AUTH section 3); the gRPC server takes Config.Auth's interceptors,
or development-mode ones when authentication is not configured, and
Config.ServerOptions. T2: every registered method has a rule and every rule
a method.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Phase 0, S3 (core part): the unary and stream interceptors authenticate
every call (PeerIdentity), apply the method's rule (people from a minimum
role up; nodes where allowed; a method without a rule is refused), and put
the principal on the context for RequireNode (own server id) and
RequireRole. A stream re-authenticates before every send and at every
role-file reload, so a removed caller loses its open stream at the reload.
Development mode marks calls explicitly; a call no interceptor saw is
refused by the handler checks (fail closed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
core/auth (phase 0, S2): ParseRoleFile/LoadRoleFile (sha256:<hex> role id),
an Authenticator whose table swaps atomically (a failed reload keeps the
previous table), and PeerIdentity: the leaf certificate the TLS handshake
verified to the client CA, its fingerprint bound to a role and id, CN equal
to that id, not expired on the master's clock; every failure is
UNAUTHENTICATED. authtest issues test CAs and certificates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The HEAD reader refused a deleting, purging or deleted HEAD as invalid,
so a never-started delete whose commit timed out (or whose mark's outcome
was unknown) was refused on every re-run: the volume stayed unusable and
undeletable. Such a HEAD can no longer be claimed, so it is past the
fence: the reader returns it with ErrWorkspaceHeadDeleting and the
verdict admits it (HolderDeleting).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The directory fsync after the rename was best-effort for every record but
a workspace lease: its error was ignored, so a write a crash could undo
was reported as written. It now fails closed for every record. Windows,
which cannot fsync a directory, skips it as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adopting the master's assignment comes before the HEAD claim; a start
that adopted and then lost the HEAD race to the delete never served.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The master's HEAD reader refused the initial HEAD (epoch 0, no holder) as
invalid, so the delete saw every never-started line as unreadable. It now
returns that HEAD with ErrWorkspaceHeadUnclaimed: every caller that needs
an identity still gets an error; the delete evidence reads it as epoch 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TERM-LIVE-HOLDER-001 (the one verdict), INV-WS-DELETE-NO-LIVE-HOLDER-001
replacing INV-WS-DELETE-NEEDS-ACK-001 (ARCHIVED with its reason), and the
M2 'none, Granted or Expired -> Deleting' transition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One pure verdict for 'live holder of V' (TERM-LIVE-HOLDER-001):
WorkspaceHolderState(line, ACK, HEAD) -> no line, drained, sealed,
never started (HEAD below the line's epoch), live, or unknown. The chunk
volume delete's admission (MarkVolumeDeleting) reads HEAD before its
locks, bounded at 5 s, and admits no line, drained and never started; a
sealed HEAD without an ACK, a live one, or an unreadable HEAD is refused
as before. The delete's HEAD compare-and-swap to deleting stays the only
fence against a claim that lands after the read. The lifecycle
DeleteVolume reads no HEAD and keeps refusing a line without an ACK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It measures the store write p99 beside the master's store before and
after the restart and asserts the bar only below 20 ms; otherwise it
reports the numbers without failing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host owns the startup wait's one bound: it keeps the wait's start and
opens the window at the first reply at or after it; the run of replies
(and the window) ends on a transport, credentials or identity refusal;
/status shows the same bound. The provider asks the host for the bound
given its own start, and checks it on the attach retry path too: a
granted attach that keeps failing no longer holds the lease for ever
without serving. An identity refusal ends on an accepted identity-checked
call (the run of replies restarts there) or after 30 s of replies with no
new identity refusal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>