mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
Per T4d mini-plan v0.3 §2.3 + G-1 v0.2 (architect+QA-signed
2026-04-25). Refs G-1 sign: pending hash (G-1 doc lives in
seaweedfs sw-block/design/v3-phase-15-t4d-3-g1-v2-read.md v0.2);
QA approval round-46 cleared T4d-3 start.
PORT items landed (G-1 v0.2 §3, items 1-5):
Item 1 — start boundary: engine.StartCatchUp gains FromLSN field;
engine emits Recovery.R + 1 (decide path + retry-loop re-emit).
Pinned by INV-REPL-CATCHUP-FROMLSN-IS-REPLICA-FLUSHED-PLUS-1 +
INV-REPL-CATCHUP-FROMLSN-FROM-ENGINE-STATE-NOT-PROBE.
Item 2 — per-call deadline: preserved unchanged (T4c-2 INV-REPL-
CATCHUP-DEADLINE-PER-CALL-SCOPE forward-carries).
Item 3 — last-sent monotonic + completion: preserved unchanged
(T4c-2 invariants forward-carry; barrier ack remains completion
truth).
Item 4 — retry budget: engine retry-loop reuses ORIGINAL Recovery.R
+ 1 on re-emit per G-1 §6.2 architect Option A (no inter-attempt
re-probe; apply gate handles over-ship). Pinned by
TestT4d3_CatchUp_RetryReusesOriginalRPlus1.
Item 5 — retention-miss escalation: T4d-1 typed-kind contract
already in place; engine branches on FailureKind. Forward-carry.
V3-NATIVE items (no V2 source per G-1 v0.2 §4):
- Engine-owned retry loop (Q1) — already in place at T4c-3
- Unified recovery command model — T4c-pre-B
- Lane-aware apply gate integration — T4d-2
- BarrierResponse.AchievedLSN as completion truth — T4c-2
- Package-boundary discipline — pinned by new
TestT4d3_Catchup_TransportNeverImportsSubstrateInternals
(parses transport .go files via go/parser; fails if any
substrate-internal package import surfaces)
Signature ripple (10 files):
- engine.StartCatchUp{FromLSN uint64} added (no removals)
- adapter.CommandExecutor.StartCatchUp interface +1 param
- transport.BlockExecutor.StartCatchUp + doCatchUp +1 param
- 4 test executor stubs (mockExecutor, closureExecutor,
policyClosureExecutor, restartExecutor) + production
HealthyPathExecutor + noopExecutor + ops nopExecutor
- transport.recovery_session.go bridge passes fromLSN=1 (legacy
StartRecoverySession path; forward-carry to T4e for explicit
fromLSN field on StartRecovery)
- adapter.adapter_test.go bridge passes fromLSN=1
- 5 transport test call sites + 3 component integration test sites
- component framework CatchUpReplica helper passes fromLSN=1
(transitional shim; tests needing explicit R+1 use direct
executor invocation per G-1 §7)
NEW TESTS (G-1 §7 test parity matrix):
- core/engine/t4d3_rplus1_test.go (3 tests):
- TestT4d3_CatchUp_Engine_RPlus1_FromOwnState_NotProbeDirectly
(pins INV-REPL-CATCHUP-FROMLSN-FROM-ENGINE-STATE-NOT-PROBE)
- TestT4d3_CatchUp_RetryReusesOriginalRPlus1 (G-1 §6.2 Option A)
- TestT4d3_StartCatchUpStruct_HasFromLSNField (compile fence)
- core/transport/t4d3_rplus1_test.go (3 tests):
- TestT4d3_CatchUp_ScansFromReplicaR_NotGenesis (substrate
receives caller-supplied fromLSN; sender does NOT add +1)
- TestT4d3_CatchUp_StartCatchUpSignature_FromLSNRequired
- TestT4d3_CatchUp_NonEmptyReplica_BlockStoreOverShipsExpected
(round-46 ADDITION 2 substrate-bound naming — opposing-
assertion regression fence per §9 caveat)
- core/transport/import_discipline_test.go (1 test):
- TestT4d3_Catchup_TransportNeverImportsSubstrateInternals
(Q3 INV-REPL-TRANSPORT-STORAGE-CONTRACT-ONLY; parses transport
sources, fails on substrate-internal imports)
- core/replication/component/t4d3_scenarios_test.go (4 tests):
- TestT4d3_CatchUp_NonEmptyReplica_ShortGap_BandwidthBounded_
Walstore (substrate-bound bandwidth observation)
- TestT4d3_CatchUp_NonEmptyReplica_ShortGap_BandwidthBounded_
Smartwal (mirror)
- TestT4d3_RetryAfterReplicaAdvanced_OverScansHandledByApplyGate
(round-46 ADDITION 1 — pins §6.2 Option A safety claim:
over-scan + apply gate per-LBA stale-skip; assertions cover
byte-exact convergence + no per-LBA regression + coverage
union completeness)
- TestT4d3_RecoveryTargetLSN1_KnownGap (CARRY-T4D-LANE-CONTEXT-
001 Option B close — SKIPPED with explicit forward-binding
for the T4e or beyond fix; gate API itself is already
lane-pure, only caller's signal source needs upgrading)
CARRY-T4D-LANE-CONTEXT-001 close (round-46 architect HARD CLOSE
CONDITION): Option B chosen (NOT Option A) because true handler/
session-context lane signal is a much larger refactor (separate
listener ports OR per-connection lane tag via session-registration
handshake OR new MessageType — all wire/transport-architectural
changes). Architect listed Option B as acceptable. The skip-marked
test documents the H=1 known gap; godoc cites
CARRY-T4D-LANE-CONTEXT-001 explicitly for catalogue cross-reference.
NOT in T4d-3 scope (deferred):
- Engine-driven recovery wiring through ReplicationVolume↔adapter
(G-1 §4 Item A integration scope) — engine retry-loop is
unit-tested; full ReplicationVolume↔adapter binding is a
follow-up task. Rationale: this commit is large enough; landing
the R+1 threading + import discipline as one piece + adding
end-to-end engine-driven recovery wiring as another keeps
reviewability tractable. T4d-4 owns the lifecycle integration;
the engine-driven-recovery wiring fits naturally there OR as a
T4d-3-followup.
Forward-carry status:
- T4d-1 typed-kind contract: forward-carries unchanged
- T4d-2 lane-pure apply gate: forward-carries; round-46 lane
discipline still honored (gate doesn't sniff lineage)
- All round-43/44 stale-skip invariants: forward-carry green
- T4c-2 6 catch-up invariants: forward-carry under R+1 threading
(verified via T4c muscle tests still passing)
- 22 packages green; 0 failures
Tests added: 11 (per G-1 §7 matrix).
Refs: T4d mini-plan v0.3 §2.3 (architect-ratified); G-1 v0.2
QA-signed (CARRY-T4D-LANE-CONTEXT-001 close condition Option B);
round-46 architect ruling (lane-pure gate); kickoff §9 (Q1/Q2/Q3).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>