You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
moonpool-journal: Journal::open must make every created ancestor directory durable #293
Downstream: PierreZ/paros#176 (run every paros role on moonpool-journal stores under at least the in-memory world's chaos) and PierreZ/paros#202. References: moonpool 9ed1360, paros 29b23e3.
Downstream evidence.Journal::open calls create_dir_all(dir) and then sync_dir(parent_of(dir)), which
syncs only the immediate parent (crates/moonpool-journal/src/journal.rs:193-194, parent_of at :165).
paros opens nested journals:
the simulation uses paros/journals/<tenant>/<journal> (crates/paros-sim/src/process.rs:1112);
production (parosd) uses data_dir/journals/... (crates/parosd/src/stores.rs:43,107).
Per moonpool's own namespace model, a child does not survive a crash when its parent's name was never made
durable. So a power loss after the first open can drop paros/, journals/ or <tenant>/. The journal, its meta (the promise and the format marker) and every accept then vanish, and the node boots amnesiac. paros refuses
to boot such a node (BootRefusal::Amnesia), but that turns a power loss into a permanently lost acceptor. This is
a production durability bug, not only a simulation one.
Smallest change. In open, sync every directory that create_dir_all created, from the deepest new one up
to the first one that already existed: sync each new directory's parent. Alternatively, document that the caller
must pre-create a durable dir, and have open refuse a non-durable path. The fix is preferred.
Determinism. No new draws beyond the sync_dir operations themselves.
Acceptance. A test in crates/moonpool-journal/tests/journal.rs:
open a/b/c/wal on a fresh disk with unsynced_dir_entry_loss_probability = 1.0;
Activity
fix(moonpool-journal): make every ancestor of a journal directory dur…