Skip to main content

Module vnode

Module vnode 

Source
Expand description

VnodeRegistry — runtime-configurable virtual node topology.

A registry owns:

  • the runtime-selected vnode count,
  • the node-per-vnode assignment (for distributed modes),
  • a monotonically increasing assignment_version used to fence stale assignment publications.

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
InvalidKeyGroupCount
A key-group count outside the supported 1..=65535 range.
KeyGroupCount
Validated number of stable key groups in a pipeline.
Locality
A node’s failure-domain locality: ordered tier values, coarsest first (e.g. ["us-east-1", "us-east-1a", "r17"]). Parsed from the node’s failure_domain gossip string.
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
VnodeAssignmentReadGuard
Read guard that pins one assignment publication while a source captures a data batch or checkpoint cursor.
VnodeAssignmentSnapshot
One immutable publication of vnode ownership and its assignment version.
VnodeRegistry
Runtime registry of vnode topology and assignment.

Constants§

DEFAULT_KEY_GROUP_COUNT
Default stable key-group count for every deployment tier.
LOCAL_NODE_ID
Stable owner identity for embedded and standalone runtimes.
MAX_KEY_GROUP_COUNT
Largest key-group count representable by the persisted checkpoint ABI.
PARTITIONING_ABI_VERSION
Durable encoding and hashing contract used to map keys to key groups.

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.
owners_per_domain
Owner counts per failure domain at isolation_tier. The largest value over vnode_count is the blast radius — the share of state affected if that one domain fails at once.
peer_owners
Distinct assigned nodes other than self_id, sorted by id — the peer set a node fans checkpoint barriers and shuffle data out to.
rendezvous_assignment
Build a vnode-to-owner assignment using Rendezvous Hashing (Highest Random Weight).