risingwave_common::util::row_id

Function bit_for_vnode

source
fn bit_for_vnode(vnode_count: usize) -> u32
Expand description

The number of bits occupied by the vnode part of a row id.

In previous versions, this was fixed to 10 bits even if the vnode count was fixed to 256. For backward compatibility, we still use 10 bits for vnode count less than or equal to 1024. For larger vnode counts, we use the smallest power of 2 that fits the vnode count.