mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-19 02:15:02 +01:00
refactor: close bounded recovery drain and invalidation seams
Move removed-replica drain and replica-scoped invalidation onto explicit core-command paths so the widened multi-replica runtime no longer depends on coarse host-side recovery handling. Made-with: Cursor
This commit is contained in:
1 parent
5fd9ec0edf
commit
43dbebfa04
12 files changed
+751
-151
No files matched your search
@@ -14,7 +14,8 @@ type Ops interface {
|
||||
StartReceiver(assignment blockvol.BlockVolumeAssignment) (bool, error)
|
||||
ConfigureShipper(volumeID string, replicas []engine.ReplicaAssignment) (executed bool, shipperConnected bool, err error)
|
||||
StartRecoveryTask(replicaID string, assignment blockvol.BlockVolumeAssignment) (bool, error)
|
||||
InvalidateSession(volumeID, reason string) (bool, error)
|
||||
DrainRecoveryTask(replicaID, reason string) (bool, error)
|
||||
InvalidateSession(volumeID, replicaID, reason string) (bool, error)
|
||||
StartCatchUp(replicaID string, targetLSN uint64) (bool, error)
|
||||
StartRebuild(replicaID string, targetLSN uint64) (bool, error)
|
||||
}
|
||||
@@ -95,8 +96,19 @@ func (d *Dispatcher) Run(cmds []engine.Command, assignment *blockvol.BlockVolume
|
||||
if executed {
|
||||
d.effects.RecordCommand(v.VolumeID, "start_recovery_task")
|
||||
}
|
||||
case engine.DrainRecoveryTaskCommand:
|
||||
if v.ReplicaID == "" {
|
||||
continue
|
||||
}
|
||||
executed, err := d.ops.DrainRecoveryTask(v.ReplicaID, v.Reason)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if executed {
|
||||
d.effects.RecordCommand(v.VolumeID, "drain_recovery_task")
|
||||
}
|
||||
case engine.InvalidateSessionCommand:
|
||||
executed, err := d.ops.InvalidateSession(v.VolumeID, v.Reason)
|
||||
executed, err := d.ops.InvalidateSession(v.VolumeID, v.ReplicaID, v.Reason)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user