#[non_exhaustive]pub enum RecoverySource {
FreelistPage,
InPageFreeBlock,
DroppedTable,
PriorVersion,
FreeblockReconstructed,
WalFrame,
CommitSnapshot,
RollbackJournal(RollbackJournalSource),
}Expand description
Which class of free space a deleted record was carved from. Records the recovery provenance so the examiner can weigh reliability by class.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FreelistPage
A whole page that was freed onto the freelist (the strongest case: the page holds only deallocated content).
InPageFreeBlock
The in-page free space (unallocated gap / freeblock slack) of a page that is still allocated. The record is genuinely deleted but more likely to be partially overwritten, so it is graded lower.
DroppedTable
A page whose table was DROPped — on the freelist with no sqlite_master
schema, so the column count was inferred from the record itself.
PriorVersion
A prior version of a still-live row: an UPDATE freed the old version
of the row into slack while the new version kept the same rowid. The
recovered values DIFFER from the current live row (e.g. an edited message
or a changed amount), so it is genuine deleted content — the edit history.
FreeblockReconstructed
A record rebuilt by freeblock reconstruction: the freed cell’s first
four bytes (payload-length + rowid varints, header_len, and the leading
serial type) were overwritten by SQLite’s freeblock header, so the record
was rebuilt from its surviving serial-type tail plus a schema template. The
rowid is destroyed (surfaced as 0), so this is the weakest in-page class
— a low-confidence “consistent with a deleted row” lead.
WalFrame
Residue carved from an uncheckpointed WAL frame’s page image rather
than the on-disk pages. A -wal frame holds a committed page version the
main file does not yet reflect; deleted cells freed within that version
survive in the frame’s slack and exist NOWHERE on disk. The record carries
the (salt1, salt2, frame_index) log-sequence provenance in
CarvedRecord::wal.
CommitSnapshot
Residue carved from a materialized commit snapshot — the database state
replayed up to one COMMIT frame of the -wal (base image ∪ committed frames
to that commit). A row that is a live cell at this commit but deleted by a
later commit survives ONLY in this snapshot’s page images. The record
carries the commit’s (salt1, salt2, commit_frame_index) LSN in
CarvedRecord::wal — the per-commit temporal coordinate, distinct from a
raw RecoverySource::WalFrame residue’s frame index.
RollbackJournal(RollbackJournalSource)
A prior allocated row from the rollback journal (design §5). The row
was LIVE in the pre-transaction state the -journal preserves and the last
transaction deleted or modified it — it is NOT a free-space residue, so
downstream reports must not relabel it as unallocated. Carries the page /
segment / header-state / checksum provenance in RollbackJournalSource.
Trait Implementations§
Source§impl Clone for RecoverySource
impl Clone for RecoverySource
Source§fn clone(&self) -> RecoverySource
fn clone(&self) -> RecoverySource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RecoverySource
Source§impl Debug for RecoverySource
impl Debug for RecoverySource
impl Eq for RecoverySource
Source§impl PartialEq for RecoverySource
impl PartialEq for RecoverySource
Source§fn eq(&self, other: &RecoverySource) -> bool
fn eq(&self, other: &RecoverySource) -> bool
self and other values to be equal, and is used by ==.