ffiwrapper: Fix sector acquire logic in unsealing
This commit is contained in:
parent
6167bcc8ce
commit
4b78c4ea1e
@ -330,7 +330,7 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storiface.Secto
|
|||||||
|
|
||||||
// if the selected worker does NOT have the sealed files for the sector, instruct it to fetch it from a worker that has them and
|
// if the selected worker does NOT have the sealed files for the sector, instruct it to fetch it from a worker that has them and
|
||||||
// put it in the sealing scratch space.
|
// put it in the sealing scratch space.
|
||||||
sealFetch := PrepareAction{
|
unsealFetch := PrepareAction{
|
||||||
Action: func(ctx context.Context, worker Worker) error {
|
Action: func(ctx context.Context, worker Worker) error {
|
||||||
log.Debugf("copy sealed/cache sector data for sector %d", sector.ID)
|
log.Debugf("copy sealed/cache sector data for sector %d", sector.ID)
|
||||||
_, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy))
|
_, err := m.waitSimpleCall(ctx)(worker.Fetch(ctx, sector, storiface.FTSealed|storiface.FTCache, storiface.PathSealing, storiface.AcquireCopy))
|
||||||
@ -359,7 +359,7 @@ func (m *Manager) SectorsUnsealPiece(ctx context.Context, sector storiface.Secto
|
|||||||
selector := newExistingSelector(m.index, sector.ID, storiface.FTSealed|storiface.FTCache, true)
|
selector := newExistingSelector(m.index, sector.ID, storiface.FTSealed|storiface.FTCache, true)
|
||||||
|
|
||||||
log.Debugf("will schedule unseal for sector %d", sector.ID)
|
log.Debugf("will schedule unseal for sector %d", sector.ID)
|
||||||
err = m.sched.Schedule(ctx, sector, sealtasks.TTUnseal, selector, sealFetch, func(ctx context.Context, w Worker) error {
|
err = m.sched.Schedule(ctx, sector, sealtasks.TTUnseal, selector, unsealFetch, func(ctx context.Context, w Worker) error {
|
||||||
// TODO: make restartable
|
// TODO: make restartable
|
||||||
|
|
||||||
// NOTE: we're unsealing the whole sector here as with SDR we can't really
|
// NOTE: we're unsealing the whole sector here as with SDR we can't really
|
||||||
|
@ -575,7 +575,7 @@ func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storiface.SectorRe
|
|||||||
return nil, xerrors.Errorf("unsealing sector: %w", err)
|
return nil, xerrors.Errorf("unsealing sector: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo move unsealed to long term storage (IN MANAGER< NOT HERE!!)
|
// note: the unsealed file is moved to long-term storage in Manager.SectorsUnsealPiece
|
||||||
|
|
||||||
storageTypes := []storiface.SectorFileType{storiface.FTSealed, storiface.FTCache, storiface.FTUpdate, storiface.FTUpdateCache}
|
storageTypes := []storiface.SectorFileType{storiface.FTSealed, storiface.FTCache, storiface.FTUpdate, storiface.FTUpdateCache}
|
||||||
for _, fileType := range storageTypes {
|
for _, fileType := range storageTypes {
|
||||||
|
Loading…
Reference in New Issue
Block a user