Files
seaweedfs/seaweed-block/deploy/systemd/sw-block.tmpfiles.conf
T
pingqiuandClaude Opus 5.5 83f8507d3b durable, blockvolume: review fold for the host lock and the rolled-back root
- The lock directory is created (0700) when missing; only a directory or
  lock file that cannot be created or opened refuses, with the cure
  (install the tmpfiles.d entry, or chown the directory and its lock files
  to the unit's user).
- The lock file is opened read-only (an existing file first, created 0644
  only when missing), so a lock file another user created stays lockable;
  it is never unlinked, and the next owner locks the same file.
- A stale-root startup end carries its cure into the final exit line:
  exiting status=78 reason=superseded cure="...".
- Tests: a cut's remote_lsn is locally durable at its HEAD CAS, and the
  root's crash image at the CAS reattaches and serves; the rolled-back copy
  makes no claim or PUT, admits no I/O, keeps its data and durable LSN; an
  exact copy at HEAD attaches; a read-only lock file is taken.
- Invariants: INV-WS-ONE-PROCESS-PER-HOST-001 and its M4 edge; the
  rollback row names its test file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:40:12 -08:00

11 lines
676 B
Plaintext

# tmpfiles.d entry for the blockvolume host volume locks. Install as
# /etc/tmpfiles.d/sw-block.conf, then run `systemd-tmpfiles --create`.
# blockvolume creates the directory when it can and refuses to start when it
# cannot (the shipped units cannot: ProtectSystem=strict). Each volume takes an
# exclusive lock on /run/sw-block/locks/<volume id>.lock, so one host runs at
# most one live blockvolume per volume. The directory is owned by the
# unprivileged units' user (sw-block) and is 0700, so no other local user can
# create or hold a volume's lock. The root ublk unit reaches it as root.
d /run/sw-block 0755 root root -
d /run/sw-block/locks 0700 sw-block sw-block -