Handle finalize failures in fsm
This commit is contained in:
parent
6d464c478e
commit
874124c4e7
@ -527,6 +527,7 @@ var stateList = []stateMeta{
|
||||
{col: color.FgRed, state: sealing.SnapDealsDealsExpired},
|
||||
{col: color.FgRed, state: sealing.ReplicaUpdateFailed},
|
||||
{col: color.FgRed, state: sealing.ReleaseSectorKeyFailed},
|
||||
{col: color.FgRed, state: sealing.FinalizeReplicaUpdateFailed},
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
6
extern/storage-sealing/fsm.go
vendored
6
extern/storage-sealing/fsm.go
vendored
@ -175,6 +175,7 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
|
||||
),
|
||||
FinalizeReplicaUpdate: planOne(
|
||||
on(SectorFinalized{}, UpdateActivating),
|
||||
on(SectorFinalizeFailed{}, FinalizeReplicaUpdateFailed),
|
||||
),
|
||||
UpdateActivating: planOne(
|
||||
on(SectorUpdateActive{}, ReleaseSectorKey),
|
||||
@ -267,6 +268,9 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
|
||||
ReleaseSectorKeyFailed: planOne(
|
||||
on(SectorUpdateActive{}, ReleaseSectorKey),
|
||||
),
|
||||
FinalizeReplicaUpdateFailed: planOne(
|
||||
on(SectorRetryFinalize{}, FinalizeReplicaUpdate),
|
||||
),
|
||||
|
||||
// Post-seal
|
||||
|
||||
@ -536,6 +540,8 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta
|
||||
return m.handleSubmitReplicaUpdateFailed, processed, nil
|
||||
case ReleaseSectorKeyFailed:
|
||||
return m.handleReleaseSectorKeyFailed, 0, err
|
||||
case FinalizeReplicaUpdateFailed:
|
||||
return m.handleFinalizeFailed, processed, nil
|
||||
case AbortUpgrade:
|
||||
return m.handleAbortUpgrade, processed, nil
|
||||
|
||||
|
2
extern/storage-sealing/sector_state.go
vendored
2
extern/storage-sealing/sector_state.go
vendored
@ -60,6 +60,7 @@ var ExistSectorStateList = map[SectorState]struct{}{
|
||||
SnapDealsRecoverDealIDs: {},
|
||||
ReplicaUpdateFailed: {},
|
||||
ReleaseSectorKeyFailed: {},
|
||||
FinalizeReplicaUpdateFailed: {},
|
||||
AbortUpgrade: {},
|
||||
}
|
||||
|
||||
@ -130,6 +131,7 @@ const (
|
||||
AbortUpgrade SectorState = "AbortUpgrade"
|
||||
ReplicaUpdateFailed SectorState = "ReplicaUpdateFailed"
|
||||
ReleaseSectorKeyFailed SectorState = "ReleaseSectorKeyFailed"
|
||||
FinalizeReplicaUpdateFailed SectorState = "FinalizeReplicaUpdateFailed"
|
||||
|
||||
Faulty SectorState = "Faulty" // sector is corrupted or gone for some reason
|
||||
FaultReported SectorState = "FaultReported" // sector has been declared as a fault on chain
|
||||
|
Loading…
Reference in New Issue
Block a user