itests: Test snapdeals abort cleanup
This commit is contained in:
@@ -425,6 +425,7 @@ func (m *Sealing) handleAbortUpgrade(ctx statemachine.Context, sector SectorInfo
|
||||
m.cleanupAssignedDeals(sector)
|
||||
|
||||
// Remove snap deals replica if any
|
||||
// This removes update / update-cache from all storage
|
||||
if err := m.sealer.ReleaseReplicaUpgrade(ctx.Context(), m.minerSector(sector.SectorType, sector.SectorNumber)); err != nil {
|
||||
return xerrors.Errorf("removing CC update files from sector storage")
|
||||
}
|
||||
@@ -434,10 +435,14 @@ func (m *Sealing) handleAbortUpgrade(ctx statemachine.Context, sector SectorInfo
|
||||
return xerrors.Errorf("getting sealing config: %w", err)
|
||||
}
|
||||
|
||||
// This removes the unsealed file from all storage
|
||||
// TODO: Pass full sector range
|
||||
if err := m.sealer.ReleaseUnsealed(ctx.Context(), m.minerSector(sector.SectorType, sector.SectorNumber), sector.keepUnsealedRanges(sector.CCPieces, true, cfg.AlwaysKeepUnsealedCopy)); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
|
||||
// TODO: Remove sealed/cache copies
|
||||
|
||||
return ctx.Send(SectorRevertUpgradeToProving{})
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,11 @@ type Sealer interface {
|
||||
// (called by the fsm on restart, allows storage to keep no persistent
|
||||
// state about unsealed fast-retrieval copies)
|
||||
ReleaseUnsealed(ctx context.Context, sector SectorRef, safeToFree []Range) error
|
||||
// ReleaseSectorKey removes `sealed` from all storage
|
||||
// called after successful sector upgrade
|
||||
ReleaseSectorKey(ctx context.Context, sector SectorRef) error
|
||||
// ReleaseReplicaUpgrade removes `update` / `update-cache` from all storage
|
||||
// called when aborting sector upgrade
|
||||
ReleaseReplicaUpgrade(ctx context.Context, sector SectorRef) error
|
||||
|
||||
// Removes all data associated with the specified sector
|
||||
|
||||
Reference in New Issue
Block a user