Skip to content

Function: reserveRegionVersions()

reserveRegionVersions(options, count): Promise<{ start: bigint; end: bigint; }>

Defined in: server/src/multi-region.ts:48

Allocate the next N region-local version numbers atomically. Used by the sync handler on every push to stamp change_log rows with a (region, local_version) pair — a scalar SQLite sequence still tracks a monotonic row_version within the region, and the causal cookie layer at the protocol boundary carries region → local_version.

v0.1 semantics: single-writer per region. Multi-writer within a region requires either a global sequencer DO (see SequencerDO sketch below) or a compare-and-swap driver adapter (out of scope).

RegionSequencerOptions

number

Promise<{ start: bigint; end: bigint; }>