Skip to main content

Module vnode

Module vnode 

Source
Expand description

VnodeRegistry — runtime-configurable virtual node topology.

Replaces the compile-time VNODE_COUNT constant that previously lived in laminar-storage. A registry owns:

  • the current vnode count (configurable; 256 by default),
  • the node-per-vnode assignment (for distributed modes),
  • a monotonically increasing assignment_version used by ObjectStoreBackend to fence out stale writers.

Vnode assignment is derived from the row’s primary key via key_hash (xxh3) and modulo vnode_count. Connectors that need a vnode ID for an event call VnodeRegistry::vnode_for_key.

Structs§

ArchivedNodeId
An archived NodeId
NodeId
Unique identifier for a node. Also the owner id for vnodes; cluster membership and vnode ownership identify the same thing.
NodeIdResolver
The resolver for an archived NodeId
VnodeRegistry
Runtime registry of vnode topology and assignment.

Functions§

key_hash
Hash a key to a 64-bit value. Used to derive vnode IDs and for any other keyed-partitioning decisions.
owned_vnodes
Vnodes currently assigned to owner.
round_robin_assignment
Build a vnode-to-owner assignment by round-robin across sorted peers.