2.3.3 Transaction Log

To ensure integrity of the files, each write to a file is structured as a transaction.

A transaction consists of the following types of data:

  • The FileNode structures (section 2.4.3) and file node lists (section 2.4) that specify the actual user data.

    New file node lists can be added by the transaction. FileNode structures in existing file node lists MUST NOT be modified or removed. New FileNode structures can be added to existing file node lists.

  • A set of TransactionEntry structures (section 2.3.3.2) that specify which file node lists are added or modified by this transaction and the new number of FileNode structures in those file node lists.

    The TransactionEntry structures for all transactions are stored sequentially in TransactionLogFragment.sizeTable. The last entry for a transaction MUST be a special sentinel entry with the value of the TransactionEntry.srcID field set to 0x00000001.

  • A Header.cTransactionsInLog field (section 2.3.1) that maintains the total number of transactions that have occurred. The transaction’s number is defined by the order of the transaction in the transaction log.

A transaction is committed only after the Header.cTransactionsInLog field is updated to match the number of the transaction. All TransactionEntry structures for transactions with higher numbers and FileNode structures added by them MUST be ignored.

The Header.fcrTransactionLog field (section 2.3.1) references the first TransactionLogFragment structure (section 2.3.3.1) in the log.