fix: sealing pipeine: Release assigned deals on snapdeals abort
This commit is contained in:
parent
abfabd267d
commit
33f7746296
@ -421,6 +421,8 @@ func (m *Sealing) handleAbortUpgrade(ctx statemachine.Context, sector SectorInfo
|
|||||||
return xerrors.Errorf("should never reach AbortUpgrade as a non-CCUpdate sector")
|
return xerrors.Errorf("should never reach AbortUpgrade as a non-CCUpdate sector")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.cleanupAssignedDeals(sector)
|
||||||
|
|
||||||
// Remove snap deals replica if any
|
// Remove snap deals replica if any
|
||||||
if err := m.sealer.ReleaseReplicaUpgrade(ctx.Context(), m.minerSector(sector.SectorType, sector.SectorNumber)); err != nil {
|
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")
|
return xerrors.Errorf("removing CC update files from sector storage")
|
||||||
|
@ -138,6 +138,12 @@ func (m *Sealing) handleProvingSector(ctx statemachine.Context, sector SectorInf
|
|||||||
delete(m.available, m.minerSectorID(sector.SectorNumber))
|
delete(m.available, m.minerSectorID(sector.SectorNumber))
|
||||||
m.inputLk.Unlock()
|
m.inputLk.Unlock()
|
||||||
|
|
||||||
|
// guard against manual state updates from snap-deals states into Proving
|
||||||
|
// note: normally snap deals should be aborted through the abort command, but
|
||||||
|
// apparently sometimes some SPs would use update-state to force the sector back
|
||||||
|
// into the Proving state, breaking the deal input pipeline in the process.
|
||||||
|
m.cleanupAssignedDeals(sector)
|
||||||
|
|
||||||
// TODO: Watch termination
|
// TODO: Watch termination
|
||||||
// TODO: Auto-extend if set
|
// TODO: Auto-extend if set
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
var DealSectorPriority = 1024
|
var DealSectorPriority = 1024
|
||||||
var MaxTicketAge = policy.MaxPreCommitRandomnessLookback
|
var MaxTicketAge = policy.MaxPreCommitRandomnessLookback
|
||||||
|
|
||||||
func (m *Sealing) handlePacking(ctx statemachine.Context, sector SectorInfo) error {
|
func (m *Sealing) cleanupAssignedDeals(sector SectorInfo) {
|
||||||
m.inputLk.Lock()
|
m.inputLk.Lock()
|
||||||
// make sure we are not accepting deals into this sector
|
// make sure we are not accepting deals into this sector
|
||||||
for _, c := range m.assignedPieces[m.minerSectorID(sector.SectorNumber)] {
|
for _, c := range m.assignedPieces[m.minerSectorID(sector.SectorNumber)] {
|
||||||
@ -51,6 +51,10 @@ func (m *Sealing) handlePacking(ctx statemachine.Context, sector SectorInfo) err
|
|||||||
delete(m.openSectors, m.minerSectorID(sector.SectorNumber))
|
delete(m.openSectors, m.minerSectorID(sector.SectorNumber))
|
||||||
delete(m.assignedPieces, m.minerSectorID(sector.SectorNumber))
|
delete(m.assignedPieces, m.minerSectorID(sector.SectorNumber))
|
||||||
m.inputLk.Unlock()
|
m.inputLk.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Sealing) handlePacking(ctx statemachine.Context, sector SectorInfo) error {
|
||||||
|
m.cleanupAssignedDeals(sector)
|
||||||
|
|
||||||
// if this is a snapdeals sector, but it ended up not having any deals, abort the upgrade
|
// if this is a snapdeals sector, but it ended up not having any deals, abort the upgrade
|
||||||
if sector.State == SnapDealsPacking && !sector.hasDeals() {
|
if sector.State == SnapDealsPacking && !sector.hasDeals() {
|
||||||
|
Loading…
Reference in New Issue
Block a user