You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(errors): unify handle-mode gating and corruption reporting
Replace the scattered ad hoc mode checks (ReadOnly/Unsupported/IdentityForked
returned inconsistently from begin_write, create_segment, rekey_db,
compaction, and apply_incremental) with a single PagedbError::WrongMode
variant and a DbModeCapabilities matrix that every gate resolves against
through Db::require_mode, so an embedder gets one variant naming both the
attempted operation and the mode that would have worked.
Fold FooterUnverifiable and StagingMissing down to the identity they can
actually authenticate (drop the unreliable embedder-visible name), add
PageUnverifiable so a per-page AEAD failure names the failing page instead of
collapsing into a bare ChecksumFailure, and drop the never-raised
FreeListExhausted/SegmentTombstoneStalled variants. Classify std::io::Error
at the one boundary every VFS call crosses so device exhaustion surfaces as
NoSpace instead of hiding inside a generic Io error. Add a RichlyReported
diagnostics guard so a site-specific corruption capture is not duplicated by
the generic constructor-level one.
Db::open (bootstrap-or-reopen decided from what is actually on disk) becomes
the only production entry point; the open_internal*/open_existing* family
that raced or skipped that decision moves behind #[cfg(test)]. OpenOptions
gains a cipher selector for stores being created. Tighten apply_incremental's
visibility window so reader admission stays closed continuously from the
tombstone pin scan through snapshot publication, and add one-shot fault
injection for the nonce-anchor commit/refresh path and two more rekey resume
points, with tests exercising each interruption.
Update every bench, benchmark, and integration test to the new API and error
shapes.
0 commit comments