分布式系统 02:实际验证记录 日期:2026-09-19 代码:examples/distributed-systems/mr02/main.go 环境:go version go1.27.0 darwin/arm64;macOS 27.0 build 26A428。 模块 go.mod 声明 go 1.23.0;未在 1.23 实跑。 工作目录:examples/distributed-systems 1. GOCACHE=/private/tmp/ds-go-cache go run -race ./mr02 退出码 0,实际输出: PASS scenario=normal maps=3 reduces=2 records=18 exact=true KILLED pid=3503 stage=map task=0 attempt=1 partial=true PASS scenario=kill maps=3 reduces=2 records=18 exact=true STALE stage=map task=0 attempt=1 current=2 rejected=true PASS scenario=late maps=3 reduces=2 records=18 exact=true 父协调者独立运行 all 情景亦通过,kill PID 为 13342(PID 不是稳定预期)。 2. GOCACHE=/private/tmp/ds-go-cache go vet ./mr02 退出码 0,无诊断。 3. GOCACHE=/private/tmp/ds-go-cache go run ./mr02 -help 退出码 0,展示 -scenario 与内部 -worker 帮助。 4. GOCACHE=/private/tmp/ds-go-cache go run ./mr02 -scenario unknown 程序报告 unknown scenario: unknown,并 exit status 2;go run 包装退出码 1。错误路径已实际运行。 5. gofmt 已执行。 变异检查 只在 /private/tmp/mr02-mutant.go 复制源码,把 publish 的 t.done || attempt != t.attempt 守卫替换为 false。 GOCACHE=/private/tmp/ds-go-cache go run /private/tmp/mr02-mutant.go -scenario late 实际 panic: stale attempt accepted,程序 exit status 2(go run 退出码 1)。正式源码没有删除守卫。 观察边界 真实启动当前二进制的 worker 子进程;通过 stdout READY 握手后杀进程,Wait 验证信号退出;半写私有 JSON 不会发布。 晚到情景由独立进程暂停、重派、释放构造,非“被杀进程复活”。新 attempt 的文件路径不同。 exact=true 对 18 个 (ID,key) 排序逐条比较,另验分区;不是仅比较总条数。 单机本地进程实验 VERIFIED_LOCAL_PROCESS;不标注 REAL_E2E 集群。 父调度器内存状态不持久化;父崩溃、网络故障、整机掉电、磁盘故障、Windows、真实分布式文件系统未验证。 顺序调度为检查边界,未做性能或扩展性测量;race 检查只覆盖本次执行。 全站 build、front matter/链接检查、浏览器验收由父协调者集成执行;本记录不预先宣称已通过。