Rebase on master
This commit is contained in:
parent
453b454b7b
commit
cf78fa99ee
@ -150,6 +150,8 @@ type StorageMiner interface {
|
|||||||
// SealingSchedDiag dumps internal sealing scheduler state
|
// SealingSchedDiag dumps internal sealing scheduler state
|
||||||
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
|
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin
|
||||||
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
|
SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin
|
||||||
|
//SealingSchedRemove removes a request from sealing pipeline
|
||||||
|
SealingRemoveRequest(ctx context.Context, sectorID abi.SectorID, task string, priority int) error //perm:admin
|
||||||
|
|
||||||
// paths.SectorIndex
|
// paths.SectorIndex
|
||||||
StorageAttach(context.Context, storiface.StorageInfo, fsutil.FsStat) error //perm:admin
|
StorageAttach(context.Context, storiface.StorageInfo, fsutil.FsStat) error //perm:admin
|
||||||
|
@ -802,6 +802,8 @@ type StorageMinerStruct struct {
|
|||||||
|
|
||||||
SealingAbort func(p0 context.Context, p1 storiface.CallID) error `perm:"admin"`
|
SealingAbort func(p0 context.Context, p1 storiface.CallID) error `perm:"admin"`
|
||||||
|
|
||||||
|
SealingRemoveRequest func(p0 context.Context, p1 abi.SectorID, p2 string, p3 int) error `perm:"admin"`
|
||||||
|
|
||||||
SealingSchedDiag func(p0 context.Context, p1 bool) (interface{}, error) `perm:"admin"`
|
SealingSchedDiag func(p0 context.Context, p1 bool) (interface{}, error) `perm:"admin"`
|
||||||
|
|
||||||
SectorAbortUpgrade func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
|
SectorAbortUpgrade func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"`
|
||||||
@ -4761,6 +4763,17 @@ func (s *StorageMinerStub) SealingAbort(p0 context.Context, p1 storiface.CallID)
|
|||||||
return ErrNotSupported
|
return ErrNotSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *StorageMinerStruct) SealingRemoveRequest(p0 context.Context, p1 abi.SectorID, p2 string, p3 int) error {
|
||||||
|
if s.Internal.SealingRemoveRequest == nil {
|
||||||
|
return ErrNotSupported
|
||||||
|
}
|
||||||
|
return s.Internal.SealingRemoveRequest(p0, p1, p2, p3)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *StorageMinerStub) SealingRemoveRequest(p0 context.Context, p1 abi.SectorID, p2 string, p3 int) error {
|
||||||
|
return ErrNotSupported
|
||||||
|
}
|
||||||
|
|
||||||
func (s *StorageMinerStruct) SealingSchedDiag(p0 context.Context, p1 bool) (interface{}, error) {
|
func (s *StorageMinerStruct) SealingSchedDiag(p0 context.Context, p1 bool) (interface{}, error) {
|
||||||
if s.Internal.SealingSchedDiag == nil {
|
if s.Internal.SealingSchedDiag == nil {
|
||||||
return nil, ErrNotSupported
|
return nil, ErrNotSupported
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -128,6 +128,7 @@
|
|||||||
* [RuntimeSubsystems](#RuntimeSubsystems)
|
* [RuntimeSubsystems](#RuntimeSubsystems)
|
||||||
* [Sealing](#Sealing)
|
* [Sealing](#Sealing)
|
||||||
* [SealingAbort](#SealingAbort)
|
* [SealingAbort](#SealingAbort)
|
||||||
|
* [SealingRemoveRequest](#SealingRemoveRequest)
|
||||||
* [SealingSchedDiag](#SealingSchedDiag)
|
* [SealingSchedDiag](#SealingSchedDiag)
|
||||||
* [Sector](#Sector)
|
* [Sector](#Sector)
|
||||||
* [SectorAbortUpgrade](#SectorAbortUpgrade)
|
* [SectorAbortUpgrade](#SectorAbortUpgrade)
|
||||||
@ -2749,6 +2750,26 @@ Inputs:
|
|||||||
|
|
||||||
Response: `{}`
|
Response: `{}`
|
||||||
|
|
||||||
|
### SealingRemoveRequest
|
||||||
|
SealingSchedRemove removes a request from sealing pipeline
|
||||||
|
|
||||||
|
|
||||||
|
Perms: admin
|
||||||
|
|
||||||
|
Inputs:
|
||||||
|
```json
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"Miner": 1000,
|
||||||
|
"Number": 9
|
||||||
|
},
|
||||||
|
"string value",
|
||||||
|
123
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Response: `{}`
|
||||||
|
|
||||||
### SealingSchedDiag
|
### SealingSchedDiag
|
||||||
SealingSchedDiag dumps internal sealing scheduler state
|
SealingSchedDiag dumps internal sealing scheduler state
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ import (
|
|||||||
"github.com/filecoin-project/lotus/storage/pipeline/sealiface"
|
"github.com/filecoin-project/lotus/storage/pipeline/sealiface"
|
||||||
"github.com/filecoin-project/lotus/storage/sealer"
|
"github.com/filecoin-project/lotus/storage/sealer"
|
||||||
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
|
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
|
||||||
|
"github.com/filecoin-project/lotus/storage/sealer/sealtasks"
|
||||||
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
||||||
"github.com/filecoin-project/lotus/storage/sectorblocks"
|
"github.com/filecoin-project/lotus/storage/sectorblocks"
|
||||||
"github.com/filecoin-project/lotus/storage/wdpost"
|
"github.com/filecoin-project/lotus/storage/wdpost"
|
||||||
@ -462,6 +463,11 @@ func (sm *StorageMinerAPI) SealingAbort(ctx context.Context, call storiface.Call
|
|||||||
return sm.StorageMgr.Abort(ctx, call)
|
return sm.StorageMgr.Abort(ctx, call)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sm *StorageMinerAPI) SealingRemoveRequest(ctx context.Context, sectorID abi.SectorID, task string, priority int) error {
|
||||||
|
rtask := sealtasks.TaskType(task)
|
||||||
|
return sm.StorageMgr.RemoveSchedRequest(ctx, sectorID, rtask, priority)
|
||||||
|
}
|
||||||
|
|
||||||
func (sm *StorageMinerAPI) MarketImportDealData(ctx context.Context, propCid cid.Cid, path string) error {
|
func (sm *StorageMinerAPI) MarketImportDealData(ctx context.Context, propCid cid.Cid, path string) error {
|
||||||
fi, err := os.Open(path)
|
fi, err := os.Open(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1168,6 +1168,12 @@ func (m *Manager) SchedDiag(ctx context.Context, doSched bool) (interface{}, err
|
|||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Manager) RemoveSchedRequest(ctx context.Context, sectorID abi.SectorID, tasktype sealtasks.TaskType, priority int) error {
|
||||||
|
m.workLk.Lock()
|
||||||
|
defer m.workLk.Unlock()
|
||||||
|
return m.sched.RemoveRequest(ctx, sectorID, tasktype, priority)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Manager) Close(ctx context.Context) error {
|
func (m *Manager) Close(ctx context.Context) error {
|
||||||
m.windowPoStSched.schedClose()
|
m.windowPoStSched.schedClose()
|
||||||
m.winningPoStSched.schedClose()
|
m.winningPoStSched.schedClose()
|
||||||
|
@ -381,6 +381,22 @@ func (sh *Scheduler) Info(ctx context.Context) (interface{}, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sh *Scheduler) RemoveRequest(ctx context.Context, sectorID abi.SectorID, tasktype sealtasks.TaskType, priority int) error {
|
||||||
|
if sh.SchedQueue.Len() < 0 {
|
||||||
|
return xerrors.Errorf("No requests in the scheduler")
|
||||||
|
}
|
||||||
|
sh.workersLk.Lock()
|
||||||
|
defer sh.workersLk.Unlock()
|
||||||
|
queue := sh.SchedQueue
|
||||||
|
for i, r := range *queue {
|
||||||
|
if r.Sector.ID == sectorID && r.Priority == priority && r.TaskType == tasktype { // TODO: Add check to ensure request in not scheduled
|
||||||
|
queue.Remove(i)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return xerrors.Errorf("No request with provided details found")
|
||||||
|
}
|
||||||
|
|
||||||
func (sh *Scheduler) Close(ctx context.Context) error {
|
func (sh *Scheduler) Close(ctx context.Context) error {
|
||||||
close(sh.closing)
|
close(sh.closing)
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user