Skip to main content

Module seq_block

Module seq_block 

Source
Expand description

Sequence block value type for block-based ID allocation.

This module provides the SeqBlock type, which represents a block of allocated sequence numbers. It is used by OpenData systems (Log, Vector, etc.) to implement efficient monotonically increasing ID allocation with crash recovery.

§Format

The SeqBlock value serializes to 16 bytes:

| base_sequence (u64 BE) | block_size (u64 BE) |

The allocated range is [base_sequence, base_sequence + block_size).

§Usage

Each system provides its own key format for storing the SeqBlock record. For example:

  • Log uses key [0x01, 0x02] (version + record type)
  • Vector uses key [0x01, 0x08] (version + record type)

Structs§

SeqBlock
A block of allocated sequence numbers.