mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
f1fb148989f368b3e46b1df4050b8060f7f8a7ed
Follow-up to 6475850. Architect review of the initial T4a-2 commit
surfaced that sw had (a) described V2 semantics incorrectly as
"transparent single-call retry" — V2 does lazy-dial → single write
→ degrade-on-fail-return-nil, no retry loop — and (b) proposed
lifting ensureDataConn into ReplicaPeer.ShipEntry, which would have
smeared transport-conn-lifecycle across core/transport +
core/replication in violation of the "core/transport = sole
net.Dial + frame-I/O owner" principle.
Architect-revised decision (v3-phase-15-t4a-2-g1-v2-read.md §6-REV):
Change 1 — Do not auto-register sessions inside Ship.
Ship's epoch fence depends on accepted-lineage. If Ship
invented sessions from incoming lineage the fence would
collapse into self-validation. Session registration stays
bound to explicit lifecycle entry points; Ship only
lazy-dials when session.conn == nil on an already-
registered session.
Change 2 — Return error on dial/write failure.
V2 return nil worked because WALShipper owned markDegraded.
V3 BlockExecutor does not own peer state. Literal return
nil would silently swallow a real fault. Ship returns
error; ReplicaPeer.ShipEntry (T4a-3) translates error →
peer-state Degraded + Invalidate.
Ship now:
- looks up session by lineage.SessionID (no auto-register)
- epoch-== silent drop preserved
- if session.conn == nil → net.DialTimeout(replicaAddr, 3s)
+ attach-under-mu with race handling:
* session invalidated during dial → close + error
* concurrent dial raced ahead → use theirs, close ours
* we win → install our conn
- 3s write deadline preserved
- dial/write error → return error (peer layer degrades)
Tests (7, all green):
- TestExecutor_Ship_SingleEntry (happy)
- TestExecutor_Ship_MultipleEntriesOrdered (order preserved)
- TestExecutor_Ship_ConnFailure (write error after attached conn)
- TestExecutor_Ship_NoSession (no auto-register — Ship errors
on unknown sessionID; preserves accepted-lineage model)
- TestExecutor_Ship_LazyDial_OnRegisteredSessionWithoutConn
(NEW: registered session no conn → lazy-dial + attach +
send; second Ship reuses attached conn)
- TestExecutor_Ship_LazyDial_DialFailure_ReturnsError (NEW:
unreachable replicaAddr → error; session stays registered)
- TestExecutor_Ship_StaleEpoch_SilentDrop (L1 §2.1 inv #2
regression; TCP-proxy-counted 0 bytes on wire)
§8C.3 trigger #1 logged in mini-plan change-log (already at
line 389-390): preserve-baseline read too narrowly at method
level, missed V2 lazy-dial stability seam. §0-B
Stability-Locality rule adopted as default G-1 heuristic for
future non-literal ports (see
memory/feedback_g1_pre_code_review.md).
Full core/transport + core/adapter suite remains green.
Languages
Go
84.5%
Rust
7.9%
Shell
2.7%
templ
1.6%
Java
1%
Other
2%