Skip to main content

Module transaction_journal_parse

Module transaction_journal_parse 

Source
Expand description

Strict parsers of every journal record. What: Strict parsers of every schema-version-2 journal record. Why: Recovery reads records either wrapper wrote; every missing or mistyped field fails closed with the record and field named, exactly as the incumbent’s commit-transaction-journal-parse.ts and commit-transaction-journal-reader.ts do.

In TS you’d write (pseudocode):

const preparing = parsePreparingRecord(bytes);

Structs§

RecordReader
What: A field reader over one untrusted record object, naming the record in failures. Why: The incumbent’s createRecordReader: each accessor fails closed with “Transaction record has a malformed field.”

Functions§

open_record
What: Parse a record’s bytes into its object after checking schema version and state. Returns the parsed object; the caller builds a reader over it. Why: The incumbent’s openRecord: fatal UTF-8, a JSON object, version 2, the expected state; anything else fails with the record named.
parse_index_lock
What: Parse index-lock-<n>.json. Why: The incumbent’s parseIndexLockRecord.
parse_landing
What: Parse landing-<n>.json. Why: The incumbent’s parseLandingRecord: a commit landing must name its new OID.
parse_prepared
What: Parse prepared.json. Why: The incumbent’s parsePreparedRecord.
parse_preparing
What: Parse preparing.json. Why: The incumbent’s parsePreparingRecord.
parse_ref_updated
What: Parse ref-updated.json into the landed commit. Why: The incumbent’s parseRefUpdatedRecord.