Module storage
Expand description
The storage seam: the only thing workers coordinate through.
There is no coordinator process in atune. Every worker — a thread, a
process running atune run, a SLURM array task — talks to one
Storage and to nothing else. Everything that makes that safe is a
property of this trait — the guide’s Storage
is the prose version:
- trial numbers are contiguous and race-safe, so seeds derived from them are too;
- state changes go through
Storage::try_transition, which reports a lost race asOk(false)rather than an error; - finished trials are immutable — which is why a failing worker records
its error text with
Storage::set_errorbefore it transitions the trial toTrialState::Failed, and why that text then survives; - reads are incremental:
Storage::syncreturns only what happened after aCursor, which is what keeps the study loop from re-reading the whole study on every decision; - side-channel state is typed and versioned (
StateBlob), not a pickled-object junk drawer.
Every backend passes one shared conformance suite: the conformance
module, exported by the crate feature of the same name, generates one test
per invariant for any backend that hands it a factory. MemStorage is
the reference implementation and the oracle the suite is calibrated
against.
Re-exports§
pub use failover::FailedOver;pub use failover::FailoverPolicy;pub use failover::fail_over_stale;pub use finalization::FinalizationAcquireRequest;pub use finalization::FinalizationObservation;pub use finalization::FinalizationToken;pub use lifecycle::AbandonRequest;pub use lifecycle::ClaimRequest;pub use lifecycle::ClaimTarget;pub use lifecycle::FailStaleRequest;pub use lifecycle::FencedMutation;pub use lifecycle::FencedMutationRequest;pub use lifecycle::FinalizedStateRequest;pub use lifecycle::LeaseObservation;pub use lifecycle::ParamWrite;pub use lifecycle::RenewRequest;pub use lifecycle::ReservationOutcome;pub use lifecycle::ReserveAndCreateRequest;pub use lifecycle::ReserveOutcome;pub use lifecycle::TerminalOutcome;pub use lifecycle::TerminalRequest;pub use lifecycle::TrialLifecycleStorage;pub use lifecycle::TrialOwnerToken;pub use lifecycle::TrialReservation;pub use outbox::EffectIntent;pub use outbox::FinalizationAdvanceRequest;pub use outbox::FinalizationIntent;pub use outbox::FinalizationPhase;pub use outbox::OutboxAdvanceRequest;pub use outbox::OutboxEffect;pub use outbox::OutboxEffectCompletion;pub use outbox::OutboxEffectIntent;pub use outbox::OutboxEffectKey;pub use outbox::OutboxKey;pub use outbox::OutboxPhase;pub use outbox::OutboxRecord;pub use outbox::REPLACEMENT_BLOB_KIND;pub use outbox::REPLACEMENT_BLOB_VERSION;pub use outbox::ReplacementOutcome;pub use outbox::ReplacementSpec;pub use outbox::replacement_scope;pub use outbox_page::DEFAULT_OUTBOX_PAGE_MAX_BYTES;pub use outbox_page::DEFAULT_OUTBOX_PAGE_MAX_RECORDS;pub use outbox_page::OutboxCursor;pub use outbox_page::OutboxPage;pub use outbox_page::OutboxPageItem;pub use outbox_page::OutboxPageRequest;
Modules§
- conformance
- The shared
Storageconformance suite — “write your own backend”. - failover
- Backend-independent stale-worker fail-over.
- finalization
- Durable, study-wide ownership for terminal finalization.
- lifecycle
- Atomic trial ownership and lifecycle capability.
- lifecycle_
conformance - Backend-independent conformance checks for
super::TrialLifecycleStorage. - outbox
- Durable terminal-finalization intent types.
- outbox_
page - Bounded, stateless traversal of durable finalization outboxes.
Structs§
- Cursor
- A position in a study’s change log.
- Import
Batch - One serializable, fully staged import.
- Import
Batch Result - Result of one atomic import publication.
- Import
Study - One study staged for import.
- Import
Trial - One trial staged for import.
- Journal
Options - Everything a
JournalStoragecan be tuned with. - Journal
Storage - A study in one append-only file:
grep-able, resumable, and shared between processes with no server. - MemStorage
- The reference in-memory
Storagebackend:RwLock-guarded, copy-on-write reads. - Snapshot
Request - A request for one hydrated storage read.
- State
Blob - A typed, versioned piece of state persisted through storage.
- Storage
Snapshot - Trial deltas and side state read for one study observation.
- Study
Summary - The stable identity data exposed by the optional study catalog.
- Sync
Page - One bounded page of
Storage::sync_limited.
Enums§
- Durability
- When the log asks the filesystem to make a publication durable.
- Import
Outcome - Terminal state represented by a staged import trial.
- Import
Trial Outcome - Outcome for one staged trial in an
ImportBatchResult. - Scope
- What a
StateBlobbelongs to. - Snapshot
Consistency - The consistency guarantee attached to a
StorageSnapshot. - Study
Create Outcome - The result of an atomic
StudyCatalog::create_if_emptyoperation. - Study
Load Outcome - The result of resolving a study name through
StudyCatalog::find_by_name.
Traits§
- Atomic
Import Storage - Optional storage capability for all-or-none import publication.
- Storage
- The persistence seam.
- Study
Catalog - Optional storage capability for stable study identity queries.