mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
8f51ec6f2967587f048800200724b1958742de67
Buffer state moves into senderBacklogSink (sinkMu / queue / sealed
fields, flushAndSeal method); Sender no longer owns any live-write
scaffolding. Sender.Run flow becomes:
StartSession → BaseLane → BaseDone → sink.StartSession →
sink.DrainBacklog → barrier → return
DrainBacklog (in the bridging sink) does scan + flushAndSeal +
seal atomically — sender.Run barriers as soon as it returns.
There is no engine "go barrier" signal anymore; the previous
sender.Close / closeCh / FinishLiveWrites pattern is gone.
Atomic-seal contract migrates from sender.drainAndSeal (queueMu)
to senderBacklogSink.flushAndSeal (sinkMu): NotifyAppend that lands
before the seal lock is captured + shipped; pushes after see
"sink sealed" error. EndSession is the defer-safety net (idempotent
seal so post-Run NotifyAppend still gets explicit error).
Deleted from Sender:
- Close(), closeCh, closeOnce
- queueMu, liveQueue, sealed, walItem
- drainAndSeal, bufferLiveWriteLocked
- PhaseAwaitClose
Deleted from PrimaryBridge:
- FinishLiveWrites (engine→sender "go barrier" signal no longer
needed — barrier auto-fires after DrainBacklog)
Updated:
- transport/rebuild_sender.go: drop FinishLiveWrites call
- sender.Run defer: just sink.EndSession + coord.EndSession
- failure.go: remove PhaseAwaitClose
Tests rewritten per architect rule 3 (delete scaffolding once e2e
cases that inject mid-session writes pass barrier convergence
through the new path):
e2e_test.go:
- 5 sender.Close() calls removed
- TestE2E_RebuildWithLiveWritesDuringSession: push live writes
BEFORE sender.Run starts — sink buffers under sinkMu until
flushAndSeal ships them
- TestE2E_KindCountsPinsBacklogVsLive: substrate switched to
memorywal (preserves write-time LSN) so push-before-Run
preserves LSN > frozenTarget filter discipline; BlockStore's
walHead-synthesized LSN would have shifted under push-before
- TestE2E_PushLiveWriteAtomicSeal: race window is now between
pushers and sink's flushAndSeal seal point; contract holds
integration_stub_test.go:
- TestIntegrationStub_LifecycleCallbacks: drop FinishLiveWrites
- TestIntegrationStub_CtxCancelUnblocksSender: skipped — no
idle wait window to cancel into post-B-2
- TestIntegrationStub_FailureTypedOnCancellation: skipped —
same reason
sender_walshipper_sink_test.go:
- TestSenderBacklogSink_NotifyAppend_BuffersForFlushAndSeal:
white-box accessor now reads sink's queue (was sender's)
- var _ WalShipperSink = &senderBacklogSink{} (pointer receiver)
- TestSender_WithSink_DelegationOrder: drop sender.Close;
Run barriers autonomously after DrainBacklog returns
Verified: all recovery (incl. 5 e2e) + transport + replication +
replication/component tests PASS. Net deletion: -175 lines.
Note: dual-lane frameWALEntry vs MsgShipEntry alignment remains
P2d. The bridging senderBacklogSink stays as the in-package sink
until then; once a real transport.WalShipper sink replaces it,
the buffer + flushAndSeal scaffolding here goes too.
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%