Skip to main content

PoolStoreWithFallbacks

Struct PoolStoreWithFallbacks 

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

A PoolStore with temporary exact-hash lookup fallbacks used during an online migration from the former hot and legacy LMDB tiers.

PoolStore remains the sole writable and enumerable store. Fallbacks are consulted only after a pool miss, so new writes stop extending the legacy migration tail immediately. Explicit deletes fail closed until the fallbacks are removed after migration.

Methods from Deref<Target = PoolStore>§

Source

pub fn delete_protection_status( &self, ) -> Result<Option<PoolDeleteProtectionStatus>, StoreError>

Source

pub fn acquire_delete_protection( &self, lease_id: [u8; 32], reason: &str, ) -> Result<PoolDeleteProtectionChange, StoreError>

Source

pub fn hold_delete_protection( &self, lease_id: [u8; 32], expected_record_sha256: [u8; 32], ) -> Result<PoolDeleteProtectionGuard, StoreError>

Hold the exact durable delete-protection record against release while a long-running online retirement audit uses it as an append-only Pool authority. Ordinary writes and physical member moves remain available.

Source

pub fn release_delete_protection( &self, lease_id: [u8; 32], expected_record_sha256: [u8; 32], ) -> Result<PoolDeleteProtectionChange, StoreError>

Source

pub fn maintain( &self, max_items: usize, ) -> Result<PoolMaintenanceReport, StoreError>

Source

pub fn maintain_with_batch_items( &self, max_items: usize, batch_items: usize, ) -> Result<PoolMaintenanceReport, StoreError>

Source

pub fn balance_temperature(&self) -> Result<PoolTemperatureReport, StoreError>

Source

pub fn stop_temperature_worker(&self) -> Result<(), StoreError>

Stop this process’s background temperature balancer.

Exact maintenance and recovery commands use this before taking catalog snapshots so the same Pool handle cannot relocate blobs behind their authority checks.

Source

pub fn add_member( &self, config: PoolMemberConfig, ) -> Result<PoolMemberId, StoreError>

Source

pub fn begin_drain(&self, id: PoolMemberId) -> Result<(), StoreError>

Source

pub fn update_member_limits( &self, id: PoolMemberId, capacity_bytes: u64, max_read_concurrency: u32, max_write_concurrency: u32, ) -> Result<(), StoreError>

Source

pub fn update_member_temperature_watermarks( &self, id: PoolMemberId, low_percent: u8, high_percent: u8, ) -> Result<(), StoreError>

Source

pub fn remove_member(&self, id: PoolMemberId) -> Result<(), StoreError>

Source

pub fn member(&self, id: PoolMemberId) -> Result<PoolMemberStatus, StoreError>

Source

pub fn members(&self) -> Result<Vec<PoolMemberStatus>, StoreError>

Source

pub fn blob_location( &self, hash: &[u8; 32], ) -> Result<Option<PoolMemberId>, StoreError>

Source

pub fn put_sync(&self, hash: [u8; 32], data: &[u8]) -> Result<bool, StoreError>

Source

pub fn put_many_report_sync( &self, items: &[([u8; 32], Vec<u8>)], ) -> Result<PutManyReport, StoreError>

Source

pub fn put_many_optimistic_report_sync( &self, items: &[([u8; 32], Vec<u8>)], ) -> Result<PutManyReport, StoreError>

Insert a locally generated content-addressed batch while trusting catalogued committed locations. Pending locations still take the ordinary repair path; stored and moving locations need no payload read.

Source

pub fn put_many_sync( &self, items: &[([u8; 32], Vec<u8>)], ) -> Result<usize, StoreError>

Source

pub fn put_many_optimistic_sync( &self, items: &[([u8; 32], Vec<u8>)], ) -> Result<usize, StoreError>

Source

pub fn get_sync(&self, hash: &[u8; 32]) -> Result<Option<Vec<u8>>, StoreError>

Source

pub fn get_range_sync( &self, hash: &[u8; 32], start: u64, end_inclusive: u64, ) -> Result<Option<Vec<u8>>, StoreError>

Source

pub fn blob_size_sync(&self, hash: &[u8; 32]) -> Result<Option<u64>, StoreError>

Source

pub fn exists(&self, hash: &[u8; 32]) -> Result<bool, StoreError>

Source

pub fn existing_hashes_in_sorted_candidates( &self, sorted_hashes: &[[u8; 32]], ) -> Result<Vec<bool>, StoreError>

Source

pub fn committed_hashes_in_sorted_candidates( &self, sorted_hashes: &[[u8; 32]], ) -> Result<Vec<bool>, StoreError>

Mark hashes whose pool catalog entries represent committed data.

Pending records deliberately return false so an interrupted migration supplies the source bytes again and lets the ordinary repair/finalize path complete them. Stored and moving records are already durable and can be skipped by an incremental migration without rereading payloads.

Source

pub fn catalog_locations_in_sorted_candidates( &self, sorted_hashes: &[[u8; 32]], ) -> Result<Vec<PoolCatalogLocation>, StoreError>

Return the exact catalog state for one sorted source page using a single read transaction.

Migration reconciliation uses this to distinguish a terminal size-matched Stored record from Missing, crash-left Pending, and non-terminal Moving without loading target payload bytes.

Source

pub fn scan_catalog_locations_after( &self, after: Option<[u8; 32]>, limit: usize, ) -> Result<Vec<([u8; 32], PoolCatalogLocation)>, StoreError>

Scan one bounded raw catalog page in hash order.

Online migration content audits use the raw catalog key as their resumable cursor. Pending and moving rows are returned explicitly: they are not terminal content authorities, but their keys must still advance the scan so a page containing only transient rows makes progress.

Source

pub fn largest_member_map_size_bytes(&self) -> Result<Option<usize>, StoreError>

Largest map size among members that are available in this process.

The pool catalog is a separate LMDB environment and is intentionally not reported as blob capacity.

Source

pub fn delete_sync(&self, hash: &[u8; 32]) -> Result<bool, StoreError>

Source

pub fn delete_many_sync(&self, hashes: &[[u8; 32]]) -> Result<usize, StoreError>

Delete a batch with one transaction per affected member and one pool catalog transaction.

Source

pub fn cleanup_stale_pending_exact_offline_sync( &self, expected: &[PoolStalePending], ) -> Result<PoolStalePendingCleanupReport, StoreError>

Clear one exact, bounded set of crash-abandoned Pending records.

This is deliberately narrower than Self::delete_many_sync: every live location must still equal the authorized (hash, member, size), no hash may be pinned or owned by a move, and no member may contain a physical record for the hash. The catalog and all secondary indexes change in one transaction and are force-synced before success.

A caller must stop and fence every Pool writer before its strict read-only audit and keep that fence through this call. This includes clones and handles in this process: a writer can commit Pending, pause before entering its member gate, and otherwise resume after cleanup. Catalog and member LMDB environments do not provide one atomic cross-environment transaction, so this method intentionally makes no online-safety claim.

Source

pub fn pin_sync(&self, hash: &[u8; 32]) -> Result<(), StoreError>

Source

pub fn unpin_sync(&self, hash: &[u8; 32]) -> Result<(), StoreError>

Source

pub fn pin_count_sync(&self, hash: &[u8; 32]) -> Result<u32, StoreError>

Source

pub fn touch_accessed_sync( &self, hash: &[u8; 32], now: u64, ) -> Result<bool, StoreError>

Source

pub fn touch_many_accessed_sync( &self, hashes: &[[u8; 32]], now: u64, ) -> Result<usize, StoreError>

Source

pub fn last_accessed_at_sync( &self, hash: &[u8; 32], ) -> Result<Option<u64>, StoreError>

Source

pub fn many_last_accessed_at_sync( &self, hashes: &[[u8; 32]], ) -> Result<Vec<([u8; 32], u64)>, StoreError>

Source

pub fn list(&self) -> Result<Vec<[u8; 32]>, StoreError>

Source

pub fn stats(&self) -> Result<StoreStats, StoreError>

Source

pub fn writable_physical_stats(&self) -> Result<StoreStats, StoreError>

Return conservative physical usage for quota admission without scanning the logical Pool catalog.

Every member LMDB maintains its own totals transactionally, so summing those counters is constant in the member count and remains accurate across processes and mixed binary versions. Blobs temporarily duplicated during a move are counted in both members, which is intentionally conservative for writable-space admission. Missing member statistics fail closed rather than undercounting storage.

Source

pub fn force_sync(&self) -> Result<(), StoreError>

Source

pub fn catalog_map_size_bytes(&self) -> u64

Current LMDB virtual map size for the Pool catalog.

Source

pub fn validate_controlled_member_state_exact(&self) -> Result<(), StoreError>

Exhaustively prove every controlled member’s physical indexes and persisted aggregate counters before the first migration mutation.

Controlled reopen performs only constant-time structural checks so bounded mapping epochs do not rescan the complete target. The caller must hold the external writer fence while this one full proof runs and must keep that fence held until migration completion.

Source

pub fn validate_controlled_authority(&self) -> Result<(), StoreError>

Revalidate every controlled catalog/member authority without forcing unrelated writer commits to storage.

This is sufficient before advancing a migration cursor when the migration observed exact Stored rows and performed no target writes. Any batch that attempted target writes must use Self::validate_controlled_authority_and_sync instead.

Source

pub fn validate_controlled_authority_and_sync(&self) -> Result<(), StoreError>

Revalidate every controlled authority and force the catalog/member commits durable before an external migration cursor may advance.

Trait Implementations§

Source§

impl Deref for PoolStoreWithFallbacks

Available on crate feature lmdb only.
Source§

type Target = PoolStore

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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<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> 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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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