mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
71e2e082c0f610d0a40066c63cc92ce04a4ddfdb
Per architect round-26 Item C.3 (symmetric pair) + round-21 uniform rule
(every authority-bearing wire surface carries full RecoveryLineage).
Probe lineage source per architect Option D (post-QA-sign clarification):
adapter mints transient probe sessionID; executor reads primaryStore
boundary for TargetLSN; engine stays pure semantic reducer; probe
lineage NOT registered in executor.sessions; no SessionPrepared /
Started / Closed lifecycle for probe.
Wire (T4c-1):
- ProbeReq: 32B body — [SessionID][Epoch][EndpointVersion][TargetLSN]
- ProbeResp: 56B body — [32B echoed lineage][8B R][8B S][8B H]
- Both directions: strict decode (short / zeroed lineage / field-order
drift rejected) mirrored from BarrierResp (T4b-1)
Replica side (replica.go MsgProbeReq):
- decodes lineage; validates via new validateProbeLineage (rejects
zeros + strictly older epoch/endpointVersion); does NOT advance
activeLineage (probe is non-mutating; advancing would race ahead of
in-flight catch-up/rebuild sessionIDs and stale-reject their frames)
- echoes lineage in 32B prefix of response
Primary side (executor.go BlockExecutor.Probe):
- new sessionID parameter (adapter-minted); reads primaryStore.Boundaries()
for TargetLSN floor (max(1, primaryH)); builds full RecoveryLineage
- sends EncodeProbeReq; validates echoed lineage on response;
ErrProbeLineageMismatch surfaces in FailReason on mismatch (mirrors
T4b-2 ErrBarrierLineageMismatch)
Adapter (adapter.go):
- prepareQueuedCommands mints transient probe sessionID for ProbeReplica
(parallel to FenceAtEpoch); executeCommand passes sessionID through
- CommandExecutor.Probe interface gains sessionID parameter; all test
executor stubs updated (mockExecutor, closureExecutor, policyClosure,
restartExecutor, HealthyPath, noop, ops nopExecutor)
INV-REPL-LINEAGE-BORNE-ON-PROBE-PAIR inscribed at catalogue §3.3 close
(both directions carry full lineage; both fail-closed on
short/zeroed/malformed; primary-side filters by full-lineage match).
Tests (21 new across 3 files):
- core/transport/probe_wire_test.go (12 wire pins)
- core/transport/probe_validation_test.go (7 replica + primary contract)
- core/adapter/probe_session_test.go (2 transient sessionID)
Existing test fix:
- TestFailClosed_ProbeDuringRebuild_DoesNotDisturbActiveLineage rewritten
as TestFailClosed_StaleProbeDuringRebuild_RejectedAndRebuildContinues —
pre-T4c-1 premise ("probe is observation only, no lineage") is
invalidated; new contract: stale probe rejected without echo,
fresh probe authority-bearing
- protocol_test envelope round-trip uses new probe shapes
- transport_test.go probe call passes sessionID
go test ./... -count=1 → all 21 packages green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Languages
Go
84.5%
Rust
7.9%
Shell
2.7%
templ
1.6%
Java
1%
Other
2%