Merge pull request #7444 from filecoin-project/feat/ap-fail-retry
sealing: Recover sectors after failed AddPiece
This commit is contained in:
commit
1993efe201
8
extern/storage-sealing/fsm.go
vendored
8
extern/storage-sealing/fsm.go
vendored
@ -135,7 +135,11 @@ var fsmPlanners = map[SectorState]func(events []statemachine.Event, state *Secto
|
||||
|
||||
// Sealing errors
|
||||
|
||||
AddPieceFailed: planOne(),
|
||||
AddPieceFailed: planOne(
|
||||
on(SectorRetryWaitDeals{}, WaitDeals),
|
||||
apply(SectorStartPacking{}),
|
||||
apply(SectorAddPiece{}),
|
||||
),
|
||||
SealPreCommit1Failed: planOne(
|
||||
on(SectorRetrySealPreCommit1{}, PreCommit1),
|
||||
),
|
||||
@ -400,6 +404,8 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta
|
||||
return m.handleFinalizeSector, processed, nil
|
||||
|
||||
// Handled failure modes
|
||||
case AddPieceFailed:
|
||||
return m.handleAddPieceFailed, processed, nil
|
||||
case SealPreCommit1Failed:
|
||||
return m.handleSealPrecommit1Failed, processed, nil
|
||||
case SealPreCommit2Failed:
|
||||
|
4
extern/storage-sealing/fsm_events.go
vendored
4
extern/storage-sealing/fsm_events.go
vendored
@ -98,6 +98,10 @@ type SectorAddPieceFailed struct{ error }
|
||||
func (evt SectorAddPieceFailed) FormatError(xerrors.Printer) (next error) { return evt.error }
|
||||
func (evt SectorAddPieceFailed) apply(si *SectorInfo) {}
|
||||
|
||||
type SectorRetryWaitDeals struct{}
|
||||
|
||||
func (evt SectorRetryWaitDeals) apply(si *SectorInfo) {}
|
||||
|
||||
type SectorStartPacking struct{}
|
||||
|
||||
func (evt SectorStartPacking) apply(*SectorInfo) {}
|
||||
|
4
extern/storage-sealing/input.go
vendored
4
extern/storage-sealing/input.go
vendored
@ -245,9 +245,7 @@ func (m *Sealing) handleAddPiece(ctx statemachine.Context, sector SectorInfo) er
|
||||
}
|
||||
|
||||
func (m *Sealing) handleAddPieceFailed(ctx statemachine.Context, sector SectorInfo) error {
|
||||
log.Errorf("No recovery plan for AddPiece failing")
|
||||
// todo: cleanup sector / just go retry (requires adding offset param to AddPiece in sector-storage for this to be safe)
|
||||
return nil
|
||||
return ctx.Send(SectorRetryWaitDeals{})
|
||||
}
|
||||
|
||||
func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, data storage.Data, deal api.PieceDealInfo) (api.SectorOffset, error) {
|
||||
|
2
extern/storage-sealing/sector_state.go
vendored
2
extern/storage-sealing/sector_state.go
vendored
@ -108,7 +108,7 @@ const (
|
||||
|
||||
func toStatState(st SectorState, finEarly bool) statSectorState {
|
||||
switch st {
|
||||
case UndefinedSectorState, Empty, WaitDeals, AddPiece:
|
||||
case UndefinedSectorState, Empty, WaitDeals, AddPiece, AddPieceFailed:
|
||||
return sstStaging
|
||||
case Packing, GetTicket, PreCommit1, PreCommit2, PreCommitting, PreCommitWait, SubmitPreCommitBatch, PreCommitBatchWait, WaitSeed, Committing, CommitFinalize, FinalizeSector:
|
||||
return sstSealing
|
||||
|
Loading…
Reference in New Issue
Block a user