Skip to main content

check_writable

Function check_writable 

Source
pub fn check_writable(path: &Path) -> Result<()>
Expand description

Refuse to start on a data directory that cannot be written to.

create_dir_all returns Ok for a directory that already exists whatever its mode, so a read-only mount, a wrong-uid volume or a typo pointing at someone else’s path gets all the way to a listening socket. The first evidence is then a flush error per export, minutes later, under load, which reads as a Mira fault rather than as a mount that was never writable — the same reasoning as check_filesystem, and the same one line in main.

The probe carries the pid because replicas may share a directory (section 10) and two of them starting together must not race each other’s cleanup.