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.
- Durable
Waiter π - A caller waiting until a region is durable through an entry id.
- Fetched
Object π - An object as recovery fetched it: its key, header and footer.
- Object
Store LogStore - A log store over the immutable WAL objects under one prefix.
- Pending
Append π - An append waiting for the object that holds its entries.
- Recovered π
- What recovery rebuilt from the objects under a prefix.
- Sealed
Batch π - A sealed and encoded batch that holds its object sequence and waits to be created, indexed and acknowledged.
EnumsΒ§
- Command π
- Create
State π - 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
enqueuedacknowledgement 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Β§
- WalObject
Io π - 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
objectand 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 toconcurrencyobjects 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_seqofobject_lenbytes from its first bytesheadand its last bytestail, 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_CONCURRENCYobjects 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 chainselect_chainpicks 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
erroras 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
epochthat 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 andconflictis returned. - start_
epoch π - Writes the empty object that starts the epoch of this instance at
object_seq, linked to the recoveredtip, 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Β§
- Append
Response π - Create
Outcome π - Obsolete
Entry πIds - Queued
Append π - Terminal
Error π