Skip to main content

node_id

Function node_id 

Source
pub fn node_id(name: &str) -> u32
Expand description

A replica’s writer identity, derived from its name with no coordination.

The block name has to be unique across every process that can ever write to this directory tree, and it has to be so without asking anyone. Hashing the replica name gets that for free: in Kubernetes the name is the pod name, which the scheduler already guarantees is unique, so uniqueness is inherited from a namespace that exists rather than invented by a protocol we would then have to operate. Truncated to 32 bits: two replicas colliding needs ~77k of them on one volume, and a collision degrades to the loud ENOTEMPTY above rather than to anything silent.