Files
seaweedfs/weed/storage/blockvol/v2bridge/recovery_bundle.go
T
pingqiuandClaude Opus 4.6 44103a1bd7 feat: Phase 20 acceptance fixes + sw-test-runner suite mode
Acceptance rows closed:
- WriteLBA/SyncCache contract: code comments document write-back vs
  durability fence semantics
- RF=2 stable identity: v2bridge always uses SetReplicaAddrs (preserves
  ServerID); blockcmd dispatcher also fixed to use setupPrimaryReplicationMulti;
  test asserts exact expected ReplicaID="vs-2" (not just non-empty)
- Tests treating WriteLBA as commit: replica_read_test rewritten with
  SyncCache as durability fence
- publish_healthy contract: 3 gate tests with hard assertions including
  gate 3 (PrimaryShipperConnected)
- SetReplicaAddr deprecation warning added
- WALShipper.ReplicaID() getter added for identity verification

Test runner enhancements:
- sw-test-runner suite command: build → deploy → run N scenarios in one
  invocation with --skip-deploy support
- Suite YAML definitions for T6 Stage 0 and Stage 1
- deploy action: kill stale processes, clean dirs, cross-compile, upload
- run-phase20-t6.ps1 PowerShell script (deprecated by suite command)

Engine/runtime fixes:
- Recovery executor nil-safety improvements
- Recovery bundle BuildRecoveryBundle defensive checks
- ShipperGroup MinReplicaFlushedLSNAll surface

Docs: acceptance checklist refined, test matrix updated, T6 runbook,
engine maintainer tutorial, design README updated.

26 files changed, ~1600 insertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 11:30:54 -07:00

36 lines
1.3 KiB
Go

package v2bridge
import (
bridge "github.com/seaweedfs/seaweedfs/sw-block/bridge/blockvol"
engine "github.com/seaweedfs/seaweedfs/sw-block/engine/replication"
"github.com/seaweedfs/seaweedfs/weed/storage/blockvol"
)
// RecoveryBundle holds the concrete bindings built from a BlockVol instance
// for one recovery execution. The host calls BuildRecoveryBundle once per
// recovery attempt; the bundle is then consumed by the runtime coordinator.
type RecoveryBundle struct {
// Storage is the engine-facing storage adapter for recovery planning.
Storage engine.StorageAdapter
// Executor implements both CatchUpIO and RebuildIO for this volume.
Executor *Executor
}
// BuildRecoveryBundle assembles all recovery bindings from a real BlockVol.
// This is the backend-binding factory — it knows how to create Reader,
// Pinner, StorageAdapter, and Executor from a concrete BlockVol instance.
//
// The host shell (block_recovery.go) calls this inside WithVolume and
// does not need to know about Reader/Pinner/StorageAdapter construction.
func BuildRecoveryBundle(vol *blockvol.BlockVol, rebuildAddr, replicaID string) *RecoveryBundle {
reader := NewReader(vol)
pinner := NewPinner(vol)
sa := bridge.NewStorageAdapter(reader, pinner)
executor := NewExecutor(vol, rebuildAddr, replicaID)
return &RecoveryBundle{
Storage: sa,
Executor: executor,
}
}