Skip to main content

VersionedLfsRows

Struct VersionedLfsRows 

Source
pub struct VersionedLfsRows<T: ?Sized> { /* private fields */ }
Expand description

The LFS rows’ write counter — the LFS liveness source’s in-process invalidation half (crate::liveness::LfsMedia’s arbitration epoch signal): bumped on every assert through the composition’s rows surface, read by the source’s arbitration consult. See VersionedLfsRows.

The counter’s discipline is narrower than the refs counter’s (crate::refs::VersionedRefTable): assert bumps, removals read back without one. The bump covers the one dangerous direction — a row landing between a sweep’s mark and a staged candidate’s arbitration (the media is newly referenced; the stale index says unreferenced; the moved counter says unknown-is-live and cancels). A removal moves coverage only downward — a stale “live” answer is the safe side and a stale “dead” answer is exact for a candidate whose rows left — and the mark’s rebuild-per-mark consult sees the truth at the next sweep either way.

The bump follows the inner call (the epoch discipline’s bump-after-commit half, shared with crate::refs::VersionedRefTable): the mark consult’s counter load rides ahead of its rows read, so only the load-before-read / bump-after-commit pairing is sound — bump lands strictly after the rows commit, and any write whose rows the mark’s read missed necessarily moves the counter past the memo’s captured epoch (the arbitration consult answers conservatively-live). The bump-before shape was reviewed out at the wave-9 gate: it let an assert’s bump land while its sqlite/pg write transaction was still in flight, letting a mark’s row read miss the uncommitted rows while catching the bump — a memo keyed on pre-assert rows and a post-bump epoch, the poisoned shape that answers exact-dead for just-referenced media once the commit lands.

The twins’ record-removal legs (the in-SQL copies inside the registry removal transactions) never touch the counter — they are removals (coverage downward, above); the mem shape’s LfsRows::remove_repo leg rides this surface and follows the same discipline.

Implementations§

Source§

impl<T: ?Sized> VersionedLfsRows<T>

Source

pub fn new(inner: Arc<T>, version: Arc<AtomicU64>) -> Self

The wrapper over the rows store and the shared counter.

Source

pub fn inner(&self) -> &Arc<T> ⓘ

The wrapped rows store.

Source

pub fn version(&self) -> u64

The counter’s current value (the liveness source’s arbitration epoch signal).

Trait Implementations§

Source§

impl<T> LfsRows for VersionedLfsRows<T>
where T: LfsRows + ?Sized,

Source§

fn assert<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, repo_id: &'life1 str, oid: &'life2 str, size: u64, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Assert a reference: insert the (repo_id, oid) row with the asserted size, or — when the pair already has a row — refresh that row’s size and change nothing else (the refcount-aware upsert: one oid re-asserted in one repo is one row).
Source§

fn remove<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, repo_id: &'life1 str, oid: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove one reference row. An absent row is a success no-op; the oid’s surviving rows recompute their refcount.
Source§

fn remove_repo<'life0, 'life1, 'async_trait>( &'life0 self, repo_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The repo-deletion leg: the repo’s rows go with the repo (its oids’ surviving rows in other repos recompute their refcount).
Source§

fn rows<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<LfsRow>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The liveness read — all rows, canonical (repo_id, oid) order.
Source§

fn repo_rows<'life0, 'life1, 'async_trait>( &'life0 self, repo_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<LfsRow>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The liveness read — one repo’s rows, canonical oid order.

Auto Trait Implementations§

§

impl<T> Freeze for VersionedLfsRows<T>
where Arc<T>: Freeze, T: ?Sized,

§

impl<T> RefUnwindSafe for VersionedLfsRows<T>
where Arc<T>: RefUnwindSafe, T: ?Sized,

§

impl<T> Send for VersionedLfsRows<T>
where Arc<T>: Send, T: ?Sized,

§

impl<T> Sync for VersionedLfsRows<T>
where Arc<T>: Sync, T: ?Sized,

§

impl<T> Unpin for VersionedLfsRows<T>
where Arc<T>: Unpin, T: ?Sized,

§

impl<T> UnsafeUnpin for VersionedLfsRows<T>
where Arc<T>: UnsafeUnpin, T: ?Sized,

§

impl<T> UnwindSafe for VersionedLfsRows<T>
where Arc<T>: UnwindSafe, T: ?Sized,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more