pub enum ModuleOverlap {
Exclusive,
Safe,
}Expand description
Whether a module tolerates a second process of itself running alongside.
Most modules are single-writer on their store (a WAL, a capture log, a
resident index behind a writer barrier), and two processes on one store
corrupt it. So a swap, which overlaps the old and new process by design,
is refused unless the module’s config opts in with overlap: "safe".
Variants§
Exclusive
Never run two processes of this module at once. The default.
Safe
The module has said a second process of itself is harmless for the length of a swap.
Declare it only if a second instance can run for a few seconds without touching ANY single-writer store: every database, WAL, index, projector and scheduled job the module owns. A lease on part of that state is not enough. broca’s session lease guards WAL appends while its run index, its store projector and its archive fold timer (which unlinks live WAL files) stay single-writer, so broca is exclusive despite holding a lease. The refusal only fires after this has been decided, so the decision is the check.