Skip to main content

Module routing

Module routing 

Source
Expand description

vShard routing for array tiles.

Arrays are sharded by Hilbert-curve prefix: the top prefix_bits of a tile’s hilbert_prefix determine which vShard bucket owns it.

With prefix_bits = P there are 2^P distinct buckets numbered 0 .. 2^P - 1. Each bucket maps to a contiguous range of vShards within the cluster’s VSHARD_COUNT-wide space. The stride is VSHARD_COUNT / 2^P (integer division). Bucket b owns vShards [b * stride .. (b + 1) * stride). The primary vShard for a bucket is the first one in that range (b * stride).

Functions§

array_vshard_for_tile
Determine the primary owning vShard for a single tile identified by its raw Hilbert-prefix value.
array_vshards_for_slice
Determine all vShards that intersect a set of Hilbert-prefix ranges.