Merge pull request #8229 from filecoin-project/fix/handle-finalize-ru-failure

fix:sealing:Handle finalize replica update failures in fsm
This commit is contained in:
ZenGround0 2022-03-02 10:40:18 -07:00 committed by GitHub
commit 14b76743c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 64 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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