Files
seaweedfs/seaweed-block/core/frontend/errors.go
T
wzcheng99 91371e5737 T1 frontend contract: core/frontend + memback + L0/L1 tests
Implements the frontend contract per T1 sketch §5-9: Identity,
Backend, Provider, ProjectionView types; ErrStalePrimary /
ErrNotReady / ErrBackendClosed sentinels; memback contract-smoke
backend that re-validates full lineage on every Read/Write.

Tests per QA test-spec:
  L0 x7 (provider open healthy + not-ready, backend read/write,
    stale read, stale write table-driven, close, boundary guard)
  L1 x1 (Publisher + VolumeBridge publication route, Epoch-bump
    move, old backend rejects, new backend serves post-move)

Two sw review notes for QA Owner:
  - Spec samples use engine.ReplicaProjection{VolumeID, ReplicaID,
    Healthy}. Actual engine type lacks those fields; per sketch §5
    the frontend defines its own Projection struct. Documented in
    file headers.
  - Spec's T1.L1.1 asserts ReplicaID change across the move.
    Cross-replica authorship requires TopologyController, not
    StaticDirective. This L1 proves Epoch-drift fence (the fence's
    actual invariant). ReplicaID-change coverage routed to L2
    over the real product route.

L2 test (T1.L2.1) not written: BLOCKED-BY-T0 per test-spec §6 —
the T0 noop executor cannot produce a frontend-serving projection
until the T1-owned readiness bridge lands in cmd/blockvolume.
2026-04-21 02:41:22 -07:00

18 lines
697 B
Go

package frontend
import "errors"
// ErrStalePrimary is returned by Backend.Read / Backend.Write
// when the current projection lineage no longer matches the
// backend's Identity (sketch §7). Every operation re-reads the
// projection; open-time validation alone is insufficient.
var ErrStalePrimary = errors.New("frontend: stale primary lineage")
// ErrNotReady is returned by Provider.Open when the projection
// never reports healthy before the context deadline.
var ErrNotReady = errors.New("frontend: volume not ready")
// ErrBackendClosed is returned by Backend.Read / Backend.Write
// after Backend.Close has been invoked.
var ErrBackendClosed = errors.New("frontend: backend closed")