Separate concurrent sealing sector limit for deals
This commit is contained in:
parent
6a7d72c030
commit
a03192a39b
3
extern/storage-sealing/sealiface/config.go
vendored
3
extern/storage-sealing/sealiface/config.go
vendored
@ -11,5 +11,8 @@ type Config struct {
|
|||||||
// includes failed, 0 = no limit
|
// includes failed, 0 = no limit
|
||||||
MaxSealingSectors uint64
|
MaxSealingSectors uint64
|
||||||
|
|
||||||
|
// includes failed, 0 = no limit
|
||||||
|
MaxSealingSectorsForDeals uint64
|
||||||
|
|
||||||
WaitDealsDelay time.Duration
|
WaitDealsDelay time.Duration
|
||||||
}
|
}
|
||||||
|
7
extern/storage-sealing/sealing.go
vendored
7
extern/storage-sealing/sealing.go
vendored
@ -270,8 +270,8 @@ func (m *Sealing) newDealSector() (abi.SectorNumber, error) {
|
|||||||
return 0, xerrors.Errorf("getting config: %w", err)
|
return 0, xerrors.Errorf("getting config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.MaxSealingSectors > 0 {
|
if cfg.MaxSealingSectorsForDeals > 0 {
|
||||||
if m.stats.curSealing() > cfg.MaxSealingSectors {
|
if m.stats.curSealing() > cfg.MaxSealingSectorsForDeals {
|
||||||
return 0, xerrors.Errorf("too many sectors sealing")
|
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
|
// run in a loop because we have to drop the map lock here for a bit
|
||||||
tries := 0
|
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 {
|
for uint64(len(m.unsealedInfoMap.infos)) >= cfg.MaxWaitDealsSectors {
|
||||||
if tries > 10 {
|
if tries > 10 {
|
||||||
// whatever...
|
// whatever...
|
||||||
|
@ -54,6 +54,9 @@ type SealingConfig struct {
|
|||||||
// includes failed, 0 = no limit
|
// includes failed, 0 = no limit
|
||||||
MaxSealingSectors uint64
|
MaxSealingSectors uint64
|
||||||
|
|
||||||
|
// includes failed, 0 = no limit
|
||||||
|
MaxSealingSectorsForDeals uint64
|
||||||
|
|
||||||
WaitDealsDelay Duration
|
WaitDealsDelay Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,9 +144,10 @@ func DefaultStorageMiner() *StorageMiner {
|
|||||||
Common: defCommon(),
|
Common: defCommon(),
|
||||||
|
|
||||||
Sealing: SealingConfig{
|
Sealing: SealingConfig{
|
||||||
MaxWaitDealsSectors: 2, // 64G with 32G sectors
|
MaxWaitDealsSectors: 2, // 64G with 32G sectors
|
||||||
MaxSealingSectors: 0,
|
MaxSealingSectors: 0,
|
||||||
WaitDealsDelay: Duration(time.Hour),
|
MaxSealingSectorsForDeals: 0,
|
||||||
|
WaitDealsDelay: Duration(time.Hour),
|
||||||
},
|
},
|
||||||
|
|
||||||
Storage: sectorstorage.SealerConfig{
|
Storage: sectorstorage.SealerConfig{
|
||||||
|
@ -611,9 +611,10 @@ func NewGetSealConfigFunc(r repo.LockedRepo) (dtypes.GetSealingConfigFunc, error
|
|||||||
return func() (out sealiface.Config, err error) {
|
return func() (out sealiface.Config, err error) {
|
||||||
err = readCfg(r, func(cfg *config.StorageMiner) {
|
err = readCfg(r, func(cfg *config.StorageMiner) {
|
||||||
out = sealiface.Config{
|
out = sealiface.Config{
|
||||||
MaxWaitDealsSectors: cfg.Sealing.MaxWaitDealsSectors,
|
MaxWaitDealsSectors: cfg.Sealing.MaxWaitDealsSectors,
|
||||||
MaxSealingSectors: cfg.Sealing.MaxSealingSectors,
|
MaxSealingSectors: cfg.Sealing.MaxSealingSectors,
|
||||||
WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay),
|
MaxSealingSectorsForDeals: cfg.Sealing.MaxSealingSectorsForDeals,
|
||||||
|
WaitDealsDelay: time.Duration(cfg.Sealing.WaitDealsDelay),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user