Skip to main content

Module store

Module store 

Source
Expand description

Object store WAL construction, recovery, writes and region reads.

StructsΒ§

Actor πŸ”’
The actor that owns the open batch and the sealed batches until they are durable.
DurableWaiter πŸ”’
A caller waiting until a region is durable through an entry id.
FetchedObject πŸ”’
An object as recovery fetched it: its key, header and footer.
ObjectStoreLogStore
A log store over the immutable WAL objects under one prefix.
PendingAppend πŸ”’
An append waiting for the object that holds its entries.
Recovered πŸ”’
What recovery rebuilt from the objects under a prefix.
SealedBatch πŸ”’
A sealed and encoded batch that holds its object sequence and waits to be created, indexed and acknowledged.

EnumsΒ§

Command πŸ”’
CreateState πŸ”’
Where the conditional create of a sealed batch stands.

ConstantsΒ§

APPEND_BUFFER πŸ”’
Appends queued for the actor; a caller beyond them waits to send.
COMMAND_BUFFER πŸ”’
CREATE_RETRY_DELAY πŸ”’
Delay before a create that failed transiently is attempted again in the enqueued acknowledgement mode, where no caller is left to retry it.
MAX_IN_FLIGHT_CREATES πŸ”’
MAX_SEALED_BATCHES πŸ”’
Number of sealed batches that may wait to be created or indexed. One admission can seal two batches, the open batch before an append that would exhaust its positions and the append’s own batch, so the actor takes an append from its channel only while two more fit: a stalled object store holds callers back instead of growing the backlog.
MIN_FLUSH_INTERVAL πŸ”’
RECOVERY_CONCURRENCY πŸ”’
Number of objects whose footers recovery fetches at a time.
RECOVERY_TAIL_WINDOW πŸ”’
Bytes recovery reads from the end of an object in one request. The window holds the trailer and the footer of an object with up to 1364 regions of 48 bytes each, so a second request for the footer is rare.

TraitsΒ§

WalObjectIo πŸ”’
Object access of the store, so tests can inject failures.

FunctionsΒ§

durable_entry_ids πŸ”’
encode_batch πŸ”’
epoch_of πŸ”’
fetch_footer πŸ”’
Reads the header, trailer and footer of object and verifies them: the header must carry the sequence of the key, the trailer must be well formed, the footer must match the checksum the trailer holds and its segments must tile the object body.
fetch_footers πŸ”’
Fetches and verifies the headers and footers of objects, up to concurrency objects at a time, and returns them ordered by object sequence whatever the order the fetches complete in. The first failure abandons the remaining fetches.
finish_recovery πŸ”’
Indexes the chain of objects, which are ordered by sequence. Objects off the chain are orphans: they are not indexed, but no later object takes their sequences.
is_transient πŸ”’
Returns true for a storage error that a later attempt may not meet: one the object store reports as temporary, or as persistent, which is how its retry layer reports a temporary error that outlasted its retries.
locate_footer πŸ”’
Verifies the header and trailer of the object object_seq of object_len bytes from its first bytes head and its last bytes tail, and returns the header and the trailer with the range the footer occupies in the object.
positive_bytes πŸ”’
record_obsolete πŸ”’
Records the obsolete watermark of region_id, which never moves down.
recover πŸ”’
Rebuilds the catalog from object headers and footers, so recovery costs a few small reads per object however large the objects are. Segments are not read; a segment checksum is verified by the read that decodes it. Footers are fetched for up to RECOVERY_CONCURRENCY objects at a time and indexed in sequence order, so the catalog checks the entry ranges of every object against its predecessors like a sequential replay. Only the objects on the chain select_chain picks are indexed.
select_chain πŸ”’
Returns, in sequence order, the objects on the chain that ends at the tip: the complete object with the largest epoch, then the largest sequence.
set_terminal πŸ”’
Records error as the terminal error unless one is already recorded, and returns the recorded one.
shared πŸ”’
Wraps an error that several callers receive.
stale_conflict πŸ”’
Resolves a create of this store’s epoch that met a different object: an object of an earlier epoch can never be on the chain, so the create fails like a transient error; an object of the same or a later epoch belongs to another writer and conflict is returned.
start_epoch πŸ”’
Writes the empty object that starts the epoch of this instance at object_seq, linked to the recovered tip, and returns it as the tip later objects extend. The epoch is one above the sequence the create claims, so no two instances share one however their opens interleave, and it is above the epoch of every object recovery listed.
terminal πŸ”’

Type AliasesΒ§

AppendResponse πŸ”’
CreateOutcome πŸ”’
ObsoleteEntryIds πŸ”’
QueuedAppend πŸ”’
TerminalError πŸ”’