Files
seaweedfs/seaweed-block/docs/spec/run.sh
T
pingqiuandClaude Opus 5.5 4408dd8ee1 docs: propose copy-before-write for the cut window, with its TLA+ model
The cut copies every candidate chunk under the capture barrier, so writes
stall for the whole copy (1.50 s at 3 GiB dirty in a lab measurement).
agent-workspace-design.md section 5 now has a proposed (not implemented)
copy-before-write design: the barrier only fixes H and the candidate set;
the first write to an uncopied candidate saves its at-H content to a local
side store; a write to a chunk being copied waits; the copier reads the side
store or the live chunk; the side store is dropped at the CAS and on crash,
and recovery never reads it. Alternatives, the open BASE-install point, and
the tests to write with the code are listed. Section 14's cut-cost gap
points at it.

docs/spec/CutCOW.tla (S4c) models today's barrier cut and the design, with a
two-step chunk copy and one crash. Both pass exhaustively at MaxLSN 6 with 2
cuts (COW 34,342,214 states, barrier 5,070,320). Each of the six design rules
is necessary: dropping any one violates BufFrozen. 11 configs, run.sh and
the spec README updated; all 13 specs pass SANY with tla2tools 1.7.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 22:02:53 -08:00

41 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Model-check one configuration with TLC.
#
# usage: ./run.sh <cfg-name> [extra TLC args]
# e.g. ./run.sh Fix_token
# TLA2TOOLS=/opt/tla/tla2tools.jar WORKERS=8 HEAP=8g ./run.sh S6_design
#
# The spec is chosen from the cfg name prefix (see README.md). Output goes to
# stdout. TLC writes its state files under ./states/ (safe to delete).
set -euo pipefail
cd "$(dirname "$0")"
cfg=${1:?usage: ./run.sh <cfg-name> [extra TLC args]}
shift
case $cfg in
Bug_*) spec=ChunkLifecycle ;;
Fix_*) spec=ChunkLifecycleFixed ;;
W4_*|RED_*) spec=WorkspaceTakeover ;;
S3_wal_*|S3v*|S3r_*|S3m_*|S3f_*) spec=WALRecovery ;;
S3_sw*) spec=SmartWALRecovery ;;
S3_rep_*) spec=WALReplica ;;
S4b_*) spec=CutPipeline ;;
S4c_*) spec=CutCOW ;;
S4_*) spec=CutCapture ;;
S5_*) spec=ControlPlane ;;
S6_*) spec=ReplicationFailover ;;
S9b_*) spec=RetentionGCMulti ;;
S9_*) spec=RetentionGCTiming ;;
*) echo "run.sh: no spec for config '$cfg'" >&2; exit 2 ;;
esac
jar=${TLA2TOOLS:-tla2tools.jar}
[ -f "$jar" ] || { echo "run.sh: $jar not found; set TLA2TOOLS (see README.md)" >&2; exit 2; }
# -deadlock: deadlock checking off. Several specs have a process that loops
# forever (the GC), and bounded models legitimately stop at their bounds.
exec java -XX:+UseParallelGC "-Xmx${HEAP:-4g}" -cp "$jar" tlc2.TLC \
-config "cfg/$cfg.cfg" -deadlock -workers "${WORKERS:-auto}" \
-metadir "states/$cfg" "$@" "$spec.tla"