Distributed Lock Service  ·  View 02 of 26  ·  1 · Context and scope

High-Level Architecture

Five stages from caller to guarded write: call, admit, decide, commit, enforce.

Editable source SVG draw.io All views
Call Caller workload Client library fence callback Admit Envoy fan-in mTLS · ring hash SPIRE SPIFFE IDs Decide Lock arbiter Go · gRPC Class registry CRDs from Git Commit Lock log etcd · Raft Audit tailer Audit store ClickHouse Enforce Guarded resource token > high-water Txn + lease watch batch write + token Distributed Lock Service — High-Level Architecture Application we own Interface / broker Security / platform Data store External / third party synchronous event / async batch The lock log decides who holds; only the resource can refuse a stale writer. v 1.0 · owner Platform Architecture · date 2026-09

Decisions

  • Callers never talk to etcd. The arbiter owns epoch checks, class rules, quotas and the wait queue, and it is the only thing holding an etcd write credential for grants.
  • The arbiter is stateless for correctness. Every fact about who holds what is in etcd, so any arbiter replica can die mid-request without leaving a grant behind that the log does not know about.
  • The audit trail is read from the log's own change stream. Nothing writes to two places, so a grant cannot exist without its audit event eventually existing.

The number that matters

  • Every acquire and every release is one Raft commit with an fsync on a majority. That round trip, not arbiter CPU, is the cost and the throughput ceiling.
  • Renewal is not on this path. It rides the session lease, which is why 250,000 held leases do not cost 50,000 writes a second.

Risks

  • The write-with-token arrow is the one reviewers skim past. If a resource ignores the token, everything upstream of it is a scheduling hint.