Loading
feat(storage): align StorageDriver/BlobStore interfaces with S06 consistency model
What
Brings the storage interface definitions in line with the S06 consistency model refined in !375 (merged) — the non-conflicting subset. Stacked on !375 (merged).
StorageDriver.Exists(ctx, path) (bool, error)— the narrow boolean existence probe Session crash-recovery needs to distinguish a finalized staging object from a vanished one (D1b) and to probedestPathafter a failed commit DB transaction (D2a/D2b). A missing object is(false, nil); the error channel is reserved for transient backend failures.StorageDriver.Writerdoc — documents thatWriter(offset>0)MUST return*OffsetDivergenceErroron a backend/DB offset mismatch (terminate-on-divergence, no self-heal).FileWriterdoc — documents that aClose/Commitbuffer-flush failure surfaces as*PartialFlushErrorand is terminal.BlobStore.ResumeSession/GetSessionStatus/Session/SessionStatusdocs — drop the staleSELECT ... FOR UPDATE/ write-lock wording, replaced with the no-locksize_bytes-CAS +dirtypoison-pill reconciliation model and theExists-probe recovery branches.
Scope notes
- No behavior change. No concrete
StorageDriverexists yet (S3/GCS land later), so addingExiststo the interface breaks no build, and there are no implementations to update. TheOffsetDivergenceError/PartialFlushErrorerror types already exist inerrors.go. - Deliberately excluded: the
ErrSessionUnrecoverabledistinct-sentinel for D2b. The spec (!375 (merged)) mandates it, but !352 (closed)'sRunCommitTxUnrecoverableconformance test asserts D2b →ErrSessionNotFound, and the currenterrors.go/stub encode that same decision. That change ships in a separate MR stacked on !352 (closed) so the contradiction is resolved in one place (stub + handler + the !352 (closed) test together).
Type label
type::maintenance — interface/doc alignment to an already-decided spec, no shippable behavior. Consistent with the sibling MRs (!375 (merged) spec, !352 (closed) tests). Relabel to type::feature if you'd rather classify the new Exists method that way.