Skip to main content

LOCK_DIR_ENV

Constant LOCK_DIR_ENV 

Source
pub const LOCK_DIR_ENV: &str = "ANT_MIGRATION_LOCK_DIR";
Expand description

Environment override for the directory the per-volume migration lock lives in.

Set this where the default cannot work, and the default cannot work wherever the nodes sharing a disk do not share a /tmp. Our own multi-node hosts are exactly that case: the systemd unit sets PrivateTmp=true, which gives every unit a tmpfs of its own, so each node creates the same lock filename in a different filesystem, every one of them takes it, and the lock serialises nothing. Point every node on a host at one directory they can all write and the lock does what it is for.

The directory must be writable by the node. A path that cannot be used is reported and the node migrates unserialised, which is the same answer as having no lock, so a typo here is loud rather than silent.