diff --git a/extern/storage-sealing/sealiface/config.go b/extern/storage-sealing/sealiface/config.go index 36fa7edad..945565562 100644 --- a/extern/storage-sealing/sealiface/config.go +++ b/extern/storage-sealing/sealiface/config.go @@ -11,5 +11,8 @@ type Config struct { // includes failed, 0 = no limit MaxSealingSectors uint64 + // includes failed, 0 = no limit + MaxSealingSectorsForDeals uint64 + WaitDealsDelay time.Duration } diff --git a/extern/storage-sealing/sealing.go b/extern/storage-sealing/sealing.go index d52f2d731..062ade2a3 100644 --- a/extern/storage-sealing/sealing.go +++ b/extern/storage-sealing/sealing.go @@ -270,8 +270,8 @@ func (m *Sealing) newDealSector() (abi.SectorNumber, error) { return 0, xerrors.Errorf("getting config: %w", err) } - if cfg.MaxSealingSectors > 0 { - if m.stats.curSealing() > cfg.MaxSealingSectors { + if cfg.MaxSealingSectorsForDeals > 0 { + if m.stats.curSealing() > cfg.MaxSealingSectorsForDeals { return 0, xerrors.Errorf("too many sectors sealing") } } @@ -280,6 +280,9 @@ func (m *Sealing) newDealSector() (abi.SectorNumber, error) { // run in a loop because we have to drop the map lock here for a bit tries := 0 + // we have to run in a loop as we're dropping unsealedInfoMap.lk + // to actually call StartPacking. When we do that, another entry can + // get added to unsealedInfoMap. for uint64(len(m.unsealedInfoMap.infos)) >= cfg.MaxWaitDealsSectors { if tries > 10 { // whatever... diff --git a/node/config/def.go b/node/config/def.go index f3b33f5aa..d10810998 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -54,6 +54,9 @@ type SealingConfig struct { // includes failed, 0 = no limit MaxSealingSectors uint64 + // includes failed, 0 = no limit + MaxSealingSectorsForDeals uint64 + WaitDealsDelay Duration } @@ -141,9 +144,10 @@ func DefaultStorageMiner() *StorageMiner { Common: defCommon(), Sealing: SealingConfig{ - MaxWaitDealsSectors: 2, // 64G with 32G sectors - MaxSealingSectors: 0, - WaitDealsDelay: Duration(time.Hour), + MaxWaitDealsSectors: 2, // 64G with 32G sectors + MaxSealingSectors: 0, + MaxSealingSectorsForDeals: 0, + WaitDealsDelay: Duration(time.Hour), }, Storage: sectorstorage.SealerConfig{ diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 3be869f0f..ce2427f2c 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -611,9 +611,10 @@ func NewGetSealConfigFunc(r repo.LockedRepo) (dtypes.GetSealingConfigFunc, error return func() (out sealiface.Config, err error) { err = readCfg(r, func(cfg *config.StorageMiner) { out = sealiface.Config{ - MaxWaitDealsSectors: cfg.Sealing.MaxWaitDealsSectors, - MaxSealingSectors: cfg.Sealing.MaxSealingSectors, - WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay), + MaxWaitDealsSectors: cfg.Sealing.MaxWaitDealsSectors, + MaxSealingSectors: cfg.Sealing.MaxSealingSectors, + MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals, + WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay), } }) return