mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-19 21:56:54 +00:00
When proactive reconnect finds WAL gap exceeds retained range: 1. Emit per-replica NeedsRebuildObserved to engine (with ReplicaID) 2. Resolve replica ctrl address from shipper group 3. Start direct rebuild session: send sessionControl(start_rebuild) to replica's ctrl channel, stream base blocks, emit RebuildStarted The primary drives the rebuild directly without master round-trip. The master sees the result via heartbeat projection (needs_rebuild → rebuilding → healthy). This matches V2 authority: master owns identity, primary owns data-control recovery. Added WALShipper.CtrlAddr() getter for address resolution. resolveCtrlAddrForShipper maps data address to ctrl address via shipper group (works for RF=2 and RF=3+). startDirectRebuild runs in a goroutine: dials replica ctrl, sends start_rebuild, waits for accepted ack, serves base blocks, emits RebuildStarted to engine on success. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>