Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug flag to force running sealing scheduler #4662

Merged
merged 1 commit into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type StorageMiner interface {
storiface.WorkerReturn

// SealingSchedDiag dumps internal sealing scheduler state
SealingSchedDiag(context.Context) (interface{}, error)
SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error)

stores.SectorIndex

Expand Down
6 changes: 3 additions & 3 deletions api/apistruct/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ type StorageMinerStruct struct {
ReturnReadPiece func(ctx context.Context, callID storiface.CallID, ok bool, err string) error `perm:"admin" retry:"true"`
ReturnFetch func(ctx context.Context, callID storiface.CallID, err string) error `perm:"admin" retry:"true"`

SealingSchedDiag func(context.Context) (interface{}, error) `perm:"admin"`
SealingSchedDiag func(context.Context, bool) (interface{}, error) `perm:"admin"`

StorageList func(context.Context) (map[stores.ID][]stores.Decl, error) `perm:"admin"`
StorageLocal func(context.Context) (map[stores.ID]string, error) `perm:"admin"`
Expand Down Expand Up @@ -1298,8 +1298,8 @@ func (c *StorageMinerStruct) ReturnFetch(ctx context.Context, callID storiface.C
return c.Internal.ReturnFetch(ctx, callID, err)
}

func (c *StorageMinerStruct) SealingSchedDiag(ctx context.Context) (interface{}, error) {
return c.Internal.SealingSchedDiag(ctx)
func (c *StorageMinerStruct) SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) {
return c.Internal.SealingSchedDiag(ctx, doSched)
}

func (c *StorageMinerStruct) StorageAttach(ctx context.Context, si stores.StorageInfo, st fsutil.FsStat) error {
Expand Down
7 changes: 6 additions & 1 deletion cmd/lotus-storage-miner/sealing.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ var sealingJobsCmd = &cli.Command{
var sealingSchedDiagCmd = &cli.Command{
Name: "sched-diag",
Usage: "Dump internal scheduler state",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "force-sched",
},
},
Action: func(cctx *cli.Context) error {
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
Expand All @@ -224,7 +229,7 @@ var sealingSchedDiagCmd = &cli.Command{

ctx := lcli.ReqContext(cctx)

st, err := nodeApi.SealingSchedDiag(ctx)
st, err := nodeApi.SealingSchedDiag(ctx, cctx.Bool("force-sched"))
if err != nil {
return err
}
Expand Down
10 changes: 9 additions & 1 deletion extern/sector-storage/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,15 @@ func (m *Manager) FsStat(ctx context.Context, id stores.ID) (fsutil.FsStat, erro
return m.storage.FsStat(ctx, id)
}

func (m *Manager) SchedDiag(ctx context.Context) (interface{}, error) {
func (m *Manager) SchedDiag(ctx context.Context, doSched bool) (interface{}, error) {
if doSched {
select {
case m.sched.workerChange <- struct{}{}:
case <-ctx.Done():
return nil, ctx.Err()
}
}

return m.sched.Info(ctx)
}

Expand Down
4 changes: 2 additions & 2 deletions node/impl/storminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ func (sm *StorageMinerAPI) WorkerConnect(ctx context.Context, url string) error
return sm.StorageMgr.AddWorker(ctx, w)
}

func (sm *StorageMinerAPI) SealingSchedDiag(ctx context.Context) (interface{}, error) {
return sm.StorageMgr.SchedDiag(ctx)
func (sm *StorageMinerAPI) SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) {
return sm.StorageMgr.SchedDiag(ctx, doSched)
}

func (sm *StorageMinerAPI) MarketImportDealData(ctx context.Context, propCid cid.Cid, path string) error {
Expand Down