Skip to main content

Module partition_assignment

Module partition_assignment 

Source
Expand description

Engine-controlled partition → vnode ownership for partitioned sources (Kafka). Pure mapping logic, ungated so it builds and is tested without a native Kafka/OpenSSL toolchain. Engine-controlled Kafka partition → vnode assignment.

In cluster mode LaminarDB owns the partition-to-node mapping rather than delegating it to Kafka’s consumer-group coordinator: each Kafka partition is bound to a vnode by partition % vnode_count, and a node consumes a partition iff it owns that vnode in the current VnodeRegistry assignment. This keeps Kafka ingestion co-located with the vnode state it feeds, so a vnode and the partitions whose data lands in it always move together on rebalance.

This module holds only the pure mapping logic (no rdkafka), so it lives outside the kafka feature gate and compiles + is unit-tested without a native Kafka/OpenSSL toolchain or a live broker. The Kafka source consumes it (under the kafka feature) and applies the result via manual assign().

Functions§

owned_partitions
The Kafka partitions (of a total_partitions-partition topic) this node owns under the registry’s current assignment.