seaweed-block: sw-block mini starts as any user with no sudo (#13421)

* seaweed-block: sw-block mini starts as any user with no sudo

blockvolume gets --volume-lock-dir, a trial-run override of the host
volume lock directory (refused under systemd and together with the test
override). sw-block mini passes <dir>/locks to its holder, so it starts
as any user on a host without /run/sw-block. mini also runs v1 with no
scheduled snapshot (it prints the command that takes one), names
sw-block and weed by their absolute paths in every command it prints,
and after a failed start stops what it started and prints the --reuse
command for the same --dir. The release archive carries
sw-block.tmpfiles.conf for the units' lock directory. The README Quick
Start drops its sudo lines, and the v1.1.1 known issue reads fixed in
v1.1.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* seaweed-block: mini under a systemd process tree, and no new lock-dir flag (on #13421) (#13425)

* seaweed-block: mini starts its children without INVOCATION_ID

Run from a systemd service's process tree (a CI runner unit, a terminal
server), mini passed INVOCATION_ID to blockvolume, which then refused
mini's lock directory and the run stopped at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* seaweed-block: mini's interrupt test expects the resume command with mini's own path

mini prints the resume command with os.Executable(), so the in-process
test saw the test binary's path, not a bare sw-block, and failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* seaweed-block: mini uses the existing hidden lock-dir override, no new flag

--volume-lock-dir set the same field as the hidden --volume-lock-dir-test-only
with the same systemd refusal, and mini was its only caller. Keep one hidden
override so operators are not offered a documented knob that drops the
one-holder-per-volume guarantee outside systemd (containers, hand-run hosts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* docs: track mini resolve helper time bounds

* Test active release assets and relative mini paths

* Complete mini release assets and bounded process checks

* Terminate owned mini groups before checking for residue

* Accept inaccessible host locks as a non-root precondition

* Harden mini test ownership and fail-stop cleanup

* test: reproduce empty filtered mini child environment

* fix(block): complete mini startup and cleanup proof

* test(block): claim the mini test's ports host-wide

The pid-derived --port-shift put mini's 13 ports inside the handoff and
weed pair ranges the other process-level harnesses claim, unclaimed, so a
parallel CI shard could bind one of them. Pick a shift whose every port is
claimed and free, as handoffAddress does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): claim the failed-start mini launch's ports too

The second launch ran at shift+1, whose ports were neither claimed nor
checked, so a parallel shard could take one and fail the launch before
it reached the deliberate blockvolume refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): exercise production mini hint with quoted paths

* docs(block): explain mini local data lock scope

* fix(block): preserve mini executable and cleanup proof

* test(block): settle a leader that exits as member capture expires

stopGroup checked done only at the top of each capture iteration. A
leader that exited after that check, once the one-second window had
passed, made the next failed read fail-stop even though the group had
settled. Both capture deadlines now defer to assertStopped when done has
closed, so live residue still fail-stops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(block): refuse a PATH weed found through the current directory

exec.LookPath reports exec.ErrDot for a weed found only through . in PATH.
Making that name absolute let exec.Command start it, where it refused
before; mini now refuses it and names --weed ./weed as the explicit choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(block): accept a reused --weed that names the recorded executable

A relative --weed made absolute from another working directory names the
same file through a different path; mini compared the strings and refused
the retry. Compare file identity when the paths differ, so a different
executable is still refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): prove the selected weed ran in the mini startup tests

A start failure and the fixture weed's exit both return 1, and the printed
command and the record exist either way. The dying fixture weed now writes
a marker file, and both startup tests require it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(block): name the mini trial lock in the M4 start arrows

The table already says a mini trial's blockvolume locks the run's
--dir/locks; the diagram's start arrows still named only the host lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(block): shell-quote mini's startup trace

Making --weed absolute can put a space from the working directory into the
printed command. Quote the executable and each argument with shQuote, as
mini's other printed commands already are, so the trace runs as printed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): count the mini group again when it is gone after a census

A member listed by the census can exit before the signal-0 query reports
ESRCH. On the iteration that crosses the deadline that stale count
fail-stopped a settled group. Count again when the group is absent, so only
a member still listed holds the settlement; the residue control still
fail-stops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): name the empty-census case in the mini group fail-stop

A group that still exists while the census lists no live member failed
with "live residue []". Say what it can be: a member the census missed,
or zombies their new parent does not reap. Both stay fail-stops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): match the quoted failed-start trace in the non-root mini test

The startup trace is shell-quoted now, and this test's weed path has a
quote in it, so match each binary through miniHintWord.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(block): let --reuse take its recorded run past a weed found through .

The exec.ErrDot refusal ran before the record was read, so a reuse of a
recorded run failed whenever . in PATH found a ./weed, although the reuse
would use the recorded weed (or none for a walstore run). A reuse now
ignores that weed; a fresh start still refuses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): match the shell-quoted start trace in the mini unit tests

mini shell-quotes each word of its "+" trace, so a TMPDIR holding a
space prints the blockmaster, blockvolume and weed paths quoted, and
three unit tests looked for them bare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(block): pin that a normal start keeps the host volume lock

A start under systemd (INVOCATION_ID set, as every shipped unit runs)
gets no lock directory of its own, so the provider uses the host one,
and the hidden test-only override is refused, naming the host lock
directory. The test is listed under INV-WS-ONE-PROCESS-PER-HOST-001.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(block): mini quotes the --weed path in its dot-in-PATH hint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-12-05 23:30:27 -08:00
1 parent 99d2116564
commit d4893ebffb
18 files changed
+1448 -56

No files matched your search

+2 -1
View File
@@ -135,8 +135,9 @@ jobs:
docker cp "$container:/usr/local/bin/$binary" "$out/bin/$binary"
done
bash seaweed-block/scripts/refuse-lab-binary.sh "$out/bin/"*
cp seaweed-block/deploy/systemd/sw-block.tmpfiles.conf "$out/bin/sw-block.tmpfiles.conf"
asset="sw-block-${version}-linux-amd64.tar.gz"
tar -C "$out/bin" -czf "$out/$asset" blockmaster blockvolume sw-block
tar -C "$out/bin" -czf "$out/$asset" blockmaster blockvolume sw-block sw-block.tmpfiles.conf
(cd "$out" && sha256sum "$asset" >SHA256SUMS)
prerelease=false
if [[ "$version" == *-* ]]; then prerelease=true; fi
+4
View File
@@ -98,6 +98,10 @@ jobs:
python3 -B ../.github/block/scripts/doc-links-check-test.py
python3 -I ../.github/block/scripts/doc-links-check.py .
- name: Release binary archive contract
if: matrix.suite == 'unit'
run: python3 -I .github/scripts/release-binary-assets-test.py
- name: Runner disk is NVMe
# A self-hosted runner whose work, temp or Go cache directory sits on a
# SATA system disk times the process-level tests out under disk load;