Skip to main content

SyncupLogView

Struct SyncupLogView 

Source
pub struct SyncupLogView { /* private fields */ }
Expand description

A scanned snapshot of one node’s replicated log, indexed by VLSN.

Built by walking the log and recording, per VLSN, its VlsnEntry (LSN, fingerprint, sync-flag). Implements SyncupView so the pure matchpoint search (find_matchpoint) and verify_rollback truth table can run against a real environment’s log.

Port of the data the JE ReplicaSyncupReader exposes (scanBackwards, findPrevSyncEntry, plus the MatchpointSearchResults counters). JE walks strictly backward for efficiency; this snapshot collects the same per-VLSN facts in one pass (the log is the source of truth either way) and answers backward queries from the in-memory map. The O(n) one-pass scan is marked below; a streaming backward reader is the upgrade path if syncup ever runs on logs too large to snapshot.

Implementations§

Source§

impl SyncupLogView

Source

pub fn scan(env_home: &Path) -> Option<Self>

Build a view by scanning the log under env_home.

Reads every entry once (forward over files for simplicity), recording the per-VLSN fingerprint/sync-flag the matchpoint search needs. Returns None only if a FileManager cannot be opened for env_home.

Source

pub fn scan_with_manager(fm: &FileManager) -> Self

Build a view from an already-open FileManager (used by the live syncup driver, which already holds one, and by tests).

Source

pub fn num_passed_commits(&self, matchpoint: Vlsn) -> u64

Count the commit/abort records strictly above matchpoint (JE MatchpointSearchResults.getNumPassedCommits). verify_rollback uses this to force HardRecovery when the backward scan stepped over a txn end even if lastTxnEnd <= matchpoint numerically.

Source

pub fn entries(&self) -> impl Iterator<Item = (Vlsn, &VlsnEntry)>

All VLSN→VlsnEntry pairs, ascending. Used by the feeder side of the syncup protocol to answer EntryRequest.

Trait Implementations§

Source§

impl SyncupView for SyncupLogView

Source§

fn last_sync(&self) -> Vlsn

Highest sync-point VLSN (VLSNRange.getLastSync) — the first matchpoint candidate.
Source§

fn last_txn_end(&self) -> Vlsn

Highest commit/abort VLSN (VLSNRange.getLastTxnEnd) — the rollback safety boundary.
Source§

fn first_vlsn(&self) -> Vlsn

First contiguous VLSN available (VLSNRange.getFirst). The search may not go below this.
Source§

fn entry(&self, vlsn: Vlsn) -> Option<VlsnEntry>

Look up the entry at vlsn, or None if this node does not hold it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V